Source code compiled from a Repository() is not put in the variant dir for a Hierarchical SCons project

后端 未结 1 1939
北荒
北荒 2021-01-07 13:52

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

相关标签:
1条回答
  • 2021-01-07 14:44

    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.

    0 讨论(0)
提交回复
热议问题