How can I get objects that are built under separate SConscripts in my program correctly? I have a directory structure that looks similar to this:
SConstruct
|
|---- moduleA
| |
| ----Sconscript
| ----src
| |-- sourceA1.cpp
| |-- sourceA2.cpp
| ----build
| |-- sourceA1.o
| |-- sourceA2.o
|
|---- moduleB
| |
| ----Sconscript
| ----src
| |-- sourceB1.cpp
| |-- sourceB2.cpp
| ----build
| |-- sourceB1.o
| |-- sourceB2.o
|
|---- Program
|
----SConscript
----src
| -- main.cpp
moduleA's SConscript might look like this (moduleB is similar):
moduleEnv = env.Clone()
srcFiles = [ 'src/sourceA1.cpp', 'src/sourceA2.cpp' ]
obj = moduleEnv.Object(srcFiles)
In my Program, I need to use the object files to build. I don't want to use a bunch of hard coded paths to do this. Is there any way that the SConscript for the program can reference the objects of the modules?
Program's SConscript
progEnv = env.Clone()
objectsList = [ Objects from the modules ] # Is this possible, or is the a better way?
prog = progEnv.Program('myprogram', [ objectList, 'src/main.cpp'])