Code::Blocks

User forums => Help => Topic started by: dragan on January 24, 2019, 11:46:05 pm

Title: Project dependencies not working?
Post by: dragan on January 24, 2019, 11:46:05 pm
As I understand, if you have workspace and you go to Properties > Project Dependencies, you can choose ohter project that should build before the primary project is built.
For example, I have the primary project named CoreBSP and other one called stb_image which produces stb_image.a library.



This is the workspace, as I can see, its ok:
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="CoreBspViewer">
<Project filename="stb_image/stb_image.cbp" />
<Project filename="CoreBSP.cbp">
<Depends filename="stb_image/stb_image.cbp" />
</Project>
</Workspace>
</CodeBlocks_workspace_file>


However, its not working at all, you have to build stb_image manually in order to link CoreBSP.

Build/Clean workspace also doesn't works, it builds only the activated project...

Am I missing something?
Im using CB 17.12 on Windows.
Title: Re: Project dependencies not working?
Post by: sodev on January 25, 2019, 12:20:10 am
You have to build the primary project to build its dependencies. Building a project X does not build other projects Y that depend on X, it only builds the projects Z that project X depends on.

Other than that, dependencies work for me, however im on r11417, but a quick check of the logs didnt reveal any changes to the dependency system after your release.
Title: Re: Project dependencies not working?
Post by: dragan on January 25, 2019, 02:17:35 am
That's odd, if I build the main project, it should first build the library.
Title: Re: Project dependencies not working?
Post by: oBFusCATed on January 25, 2019, 02:20:53 am
You have to have matching target names in both projects. If they aren't matching then nothing would be built.
Title: Re: Project dependencies not working?
Post by: dragan on January 25, 2019, 02:28:29 am
Oh, wait, you're right, my target names are different indeed, it works now  8)

Thanks!