I'm building a modular project with SCONS. I'd like to have multiple SW products to be compiled as a colleciton of multiple SW subcomponents:
Eg: *Sconstruct:
Sconscript("SW_PRODUCT_1.Sconscript")
Sconscript("SW_PRODUCT_2.Sconscript")
*With SW_PRODUCT_1.Sconscript:
Sconscript("COMPONENT_A.Sconscript")
Sconscript("COMPONENT_B.Sconscript")
Sconscript("COMPONENT_C.Sconscript")
*And with SW_PRODUCT_2.Sconscript:
Sconscript("COMPONENT_A.Sconscript")
Sconscript("COMPONENT_B.Sconscript")
ie I'd like the Builder compile once each component as a Library, and then each SW_PRODUCT take the list of components it wants to build an executable.
But I have the next problem , the SCONS tool returns the next error:
"scons: *** Two environments with different actions were specified for the same target"
This is truth since according to the script the components A and B are invoked twice with exactly the same target names but I hope the SCONS would handle the fact that multiple Targets can share libraries. I expected the SCONS to realize in the second call to COMPONENTS_A and B that the target "up to date" but it does not work that way.
I've though about a workaround compiling two diferent Libraries (different name) for each PRODUCT but that is not what I want since the Libraries are exactly the same and I don't want to waste compilation time to build exactly the same N times. I would like just to build the same pool of libraries and then pick such libraries on demand with each product.
Is there any easy way to handle this architecture with Scons?