Author Topic: Project dependencies not working?  (Read 580 times)

Offline dragan

  • Single posting newcomer
  • *
  • Posts: 3
Project dependencies not working?
« 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.

Offline sodev

  • Regular
  • ***
  • Posts: 311
Re: Project dependencies not working?
« Reply #1 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.

Offline dragan

  • Single posting newcomer
  • *
  • Posts: 3
Re: Project dependencies not working?
« Reply #2 on: January 25, 2019, 02:17:35 am »
That's odd, if I build the main project, it should first build the library.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11899
    • Travis build status
Re: Project dependencies not working?
« Reply #3 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline dragan

  • Single posting newcomer
  • *
  • Posts: 3
Re: Project dependencies not working?
« Reply #4 on: January 25, 2019, 02:28:29 am »
Oh, wait, you're right, my target names are different indeed, it works now  8)

Thanks!
« Last Edit: January 25, 2019, 02:30:19 am by dragan »