I have a Hierarchical project that uses source code from a common system-directory, for which I am using the SCons Repository()
function and want all the build
I asked this same question on the SCons-users mailing list, and received some information that partly answers this question. Thanks to Dirk Baechle
for helping me with this issue.
The Repository()
function effectively mounts the directory passed in to the root of the SCons project: that is to the directory where the SConstruct
file is. If files in a repo sub-directory need to be referenced in sub-directories of the SCons project, then the sub-directory names (that of the repo dir and scons project dir) must match. That's why the different options in the SConscript
file in the question above fail to find the repo file.
If the repo sub-directory moduleA
existed with the file repoFile.cc
, then it would be found as expected and the compiled object would be placed in the variant_dir as expected.
One limitation I see to the Repository()
function is that you can't mount the repo directory to a SCons project sub-directory. This sounds like a feature request.
The fact that SCons places the compiled object file in the source directory seems like a bug to me. At the very least, it should be placed in the variant_dir root directory.