简体   繁体   English

为什么我在scons中的subdir定义不起作用?

[英]Why my defines of subdirs in scons does not work?

I'm start to use scons to add a new sub-directory and its SConscript. 我开始使用scons添加一个新的子目录及其SConscript。 But I found my SConscript does not be read into root SConscript, I don't know why. 但是我发现我的SConscript没有被读入根SConscript,我不知道为什么。 Does I miss something? 我会错过什么吗?

Scons files in my project is as bellow : 我的项目中的Scons文件如下所示:

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

The SConscript of root is as bellow : root的SConscript如下所示:

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

In AAAA sub-directory, I have SConscript file. 在AAAA子目录中,我有SConscript文件。 But scons does not read this SConscript file in AAAA directory in actually. 但是scons实际上不会在AAAA目录中读取此SConscript文件。 Its log is as bellow: 它的日志如下:

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.

Your file tree doesn't show where the AAAA folder is located, and the definition of AAAA in your top-level SConstruct is unclear too (is it a string, or defined as something else?). 您的文件树没有显示AAAA文件夹的位置,并且顶层SConstruct中AAAA的定义也不清楚(它是字符串还是其他名称?)。 This makes it impossible to guess what's wrong. 这样就不可能猜测出什么问题了。 In any case, I recommend to have a look at the official documentation in the form of the UserGuide ( http://www.scons.org/doc/production/HTML/scons-user.html ) and follow the basic setup as described in chap. 无论如何,我建议您以UserGuide( http://www.scons.org/doc/production/HTML/scons-user.html )的形式查看官方文档,并按照说明进行基本设置在第一章。 14 "Hierarchical Builds". 14“层次结构”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM