rnunes
rnunes

Reputation: 2835

Eclipse CDT compile static lib with main project compiler settings

I have a C++ embedded project with mixed C project that uses 2 static libraries (inside static library projects).

The static libraries require some symbols that changes for each target board, but at this point it looks like I can only set the compiler settings/symbols per project.

Is there any way I can make the static library recompile everytime the main application compiler settings/symbols changes?

Upvotes: 0

Views: 95

Answers (1)

Niall
Niall

Reputation: 30605

Is there any way I can make the static library recompile everytime the main application compiler settings/symbols changes?

I think you are looking at this back to front. Instead of trying to rebuild the static library every time - build two static libraries. Even if the two libraries share the same code, the fact that they contain different symbols or some fundamental variation for each target board makes them two separate libraries that need to be built. The same would be applicable for the projects as a whole.

A similar situation is seen on the PC side as well - x86 vs. x64 as typical targets. The same project can be used to manage the code, but there are two distinct target platforms - when you build for both, you cannot share the same physical static libraries. Any static libraries you depend on are built to target each platform - hence the "x86" version of the library and the "x64" version.

Upvotes: 1

Related Questions