See if External dependency is what you want.
http://forums.codeblocks.org/index.php/topic,14278.msg95969.html#msg95969
Tim S.
Thank you for replying. I have looked at this now and considered various ways of applying the proposed solution, but I still see some significant issues
First, I don't think it addresses "Problem2 (linux)" at all as I described it? Will adding more dependency info cause less code to be compiled? The problem there was that everything seemed to be compiled every time.
Second, I have tested (on Windows) if adding "external dependencies" might help with "Problem1 (Windows)", and to some degree it cures the problem by creating another:
I have now told Code::Blocks in 3 different ways that it is supposed to depend on and use the static libraries:
- in the linker settings, the libraries are mentioned (in proper order, suffix can be ignored)
- in the Project's dependencies, the library projects are checked
- in the Build target dependencies (names must be specified with full path, name and file suffix).
So for a project with 4 build targets, you must list the names of the libraries you depend on 2x4=8 times , plus check the libraries in the project dependencies. Is there really no easier way?
Also, editing the project file by hand offers little help in this, the syntax used for external dependencies is not very readable (CPDE_USR is an environment variable I use):
<Option external_deps="$(CPDE_USR)/lib/lib_a.lib;$(CPDE_USR)/lib/lib_b.lib;" />
This is in contrast to the linker specification syntax, which is easier to deal with
<Add library="lib_a" />
<Add library="lib_b" />
I understand that we talk about several different things here
1. which libraries should this project link against
2. which projects should compile before this project
3. which files should be checked to determine if a relink of this project is needed
Somehow I feel that #3, using the existing external dependency feature, in the general case requires too much of the Code::Blocks user. I would much rather have a check-box option (for example under "Project build options") that one would have to enable and which would have the following meaning:
"External dependency for any library mentioned in the linker's library list is implied".
If you had such a feature and enabled it for a project, then any library in the linker list would become an external dependency. The effect is that maintenance of such project/workspaces would become much easier (and more user friendly) in my opinion.
In summary
- Problem1 really needs a simpler solution, as described.
- Problem2 is unsolved
Comments and further help much appreciated