Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Dependencies handling ?

(1/5) > >>

zieQ:
Well, I'm trying to solve the visual c++ workspace bad imports, and i have problem converting project dependencies to codeblocks.

In Visual C++, I think there's 2 sorts of dependencies:
- inter-project dependencies: say there's 2 project A and B, if A depends on B, A should be recompiled if B is modified and A should link B.
- intra-project dependencies: some external files (i.e. not .cpp or .h) should issue a compilation when modified, often due to a custom rule. For example, lexer files, resources files produce source or object files to compile/link with.

I had a deep look into Code::Blocks but i'm lost with the dependencies features !
- GetExternalDeps : i think it's the intra-project dependencies
- SetDepsOutput: I don't understand what it is for !

My questions are:
- is inter-project dependencies exist in Code::Blocks ?
- if yes, how could i say that a project A depend on a project B
- if not, could this be implemented, or at least the methods in the project class so i could finish the visual workspace loader ?
- should I use a workaround, that is linking explicitly my library B to A ?

zieQ

mandrav:

--- Quote ---My questions are:
- is inter-project dependencies exist in Code::Blocks ?
- if yes, how could i say that a project A depend on a project B
- if not, could this be implemented, or at least the methods in the project class so i could finish the visual workspace loader ?
- should I use a workaround, that is linking explicitly my library B to A ?
--- End quote ---

ProjectBuildTarget::SetExternalDeps() is what you want. Any file you put there, its timestamp is checked and if more recent than the current target's output, it forces re-linking.

Yiannis.

zieQ:
Where are the intra-project dependencies then ? That is, how can I set a custom rule that compile a lexer file and produce a source file, and the project to recompile the generated file when the lexer file is modified ! Must I add the generated source file somewhere to be compiled ?

I also made a search for GetExternalDeps calls, they seem not to be used when compiling ?!! I'll make some quick test to check that !

And what file must I add to External Deps ?? lib file may not have been generated !

zieQ:
I've just tested the external dependencies "feature" with 2 projects, one building a static library and one exe to link with the library.

When i click to set external deps, I'm only able to set a (existing) file, not a project name ! I set the .cdb file and the library file as dependencies of the exe project. Now the exe project is set as active. When I change the .cpp file of the library, the library is not recompiled ! When I change the .h of the library, only the exe project recompile (since the .h file is included in the main.cpp). So the external deps are not used (or nothing indicates that they are used).

So I conclude: there's no inter-project dependencies in codeblocks !! No ! Where are my answers ?  :P

zieQ:
UP ? How could I set-up inter-project dependencies ?
Do you plan to add the related functions in the sdk soon ?

Navigation

[0] Message Index

[#] Next page

Go to full version