为什么我在scons中定义子目录不起作用?

时间:2015-09-24 07:15:47

标签: python scons subdirs

我开始使用scons添加一个新的子目录及其SConscript。但我发现我的SConscript不会被读入根SConscript,我不知道为什么。我错过了什么吗?

我项目中的Scons文件如下:

project-root
 - SConstruct
 - Sconscript
 + supportlib
    - SConscript (returning library target)
    + src
       - ...
 + Program
    - SConsctipt (importing library target)
    + src
       - ...

root的SConscript如下:

subdirs = [..., AAAA]
SConscript(dirs = subdirs, exports='env')

在AAAA子目录中,我有SConscript文件。但是scons实际上并没有在AAAA目录中读取这个SConscript文件。它的日志如下:

scons: Reading SConscript files ...
...
Enable AAAA:        True
...
scons: warning: Two different environments were specified for target dummy_register_server.o,
        but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES
File "/root/workspace/xorp.ct/xorp/site_scons/site_tools/autotest.py", line 85, in _UnitTest

scons: warning: Two different environments were specified for target /root/workspace/xorp.ct/xorp/obj/i686-pc-linux-gnu/rib/parser.o,
        but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES
File "/root/workspace/xorp.ct/xorp/site_scons/site_tools/autotest.py", line 85, in _UnitTest

scons: warning: Two different environments were specified for target dummy_register_server.o,
        but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES
File "/root/workspace/xorp.ct/xorp/site_scons/site_tools/autotest.py", line 85, in _UnitTest

scons: warning: Two different environments were specified for target aspath.os,
        but they appear to have the same action: $SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES
File "/root/workspace/xorp.ct/xorp/bgp/SConscript", line 169, in <module>
...
scons: done reading SConscript files.
scons: Building targets ...
scons: every thing is up to date. ***# but there is no AAAA target report.***
scons: done building targets.

1 个答案:

答案 0 :(得分:1)

您的文件树没有显示AAAA文件夹的位置,顶层SConstruct中AAAA的定义也不清楚(是字符串,还是定义为其他?)。这使得无法猜出错误是什么。无论如何,我建议以UserGuide(http://www.scons.org/doc/production/HTML/scons-user.html)的形式查看官方文档,并按照第5章中所述的基本设置进行操作。 14&#34;分层构建&#34;。