|Exe project builds dependent libs in lib current config, not exe config [message #1782480]
||Fri, 23 February 2018 21:50
| Rick Schneider
Registered: February 2018
I have a workspace with 2 projects, an exe and a shared library.
The exe is set up with a project reference to the library project, and lists the library and library search path under C/C++ General under GNU ARM Cross C Linker->Libraries. The library search path is set to use "$(workspace_loc:/mylib/$(ConfigName))" - this is so that when building the Release mode exe, it links with the Release mode lib, and vice versa.
If both exe and lib project are both set manually to the same build config, say both in Release mode, all works well - starting clean, building the exe will build the dependent lib, and it links.
But if I change the exe build config say from Release to Debug, but do not also do the same for the lib project build config, it fails to link. What happens after a clean in this situation is the exe knows to build the dependent lib, but it builds the lib in Release mode (the currently Active mode for the lib project) - not Debug mode which is what the exe project is currently building in and Active. And then it fails to link because the expected mode lib output file is not there.
This seems pretty basic for an IDE - when building an app with a dependent lib, the Release/Debug mode of the app should also be the same mode used to rebuild the dependent lib. How to accomplish this?
|Re: Exe project builds dependent libs in lib current config, not exe config [message #1782598 is a reply to message #1782480]
||Tue, 27 February 2018 01:07
Registered: October 2012
What you are looking for is a global build configuration name.|
I don't think there is one.
The build configurations are kept in the project file .
The names Release and Debug are commonly used
but they don't have to be the same between projects.
They could just as easily be Config1, Config2, etc.
I have a managed build project that only has Default
Besides they don't have to mean debug vs release,
e.g., they could simply have differing build variable values or header files.
You might want to look into some of the available macro plugins
and create a macro that sets the active configuration in linked projects.
[Updated on: Tue, 27 February 2018 01:15]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01599 seconds