简体   繁体   中英

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. But I found my SConscript does not be read into root SConscript, I don't know why. Does I miss something?

Scons files in my project is as bellow :

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

The SConscript of root is as bellow :

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

In AAAA sub-directory, I have SConscript file. But scons does not read this SConscript file in AAAA directory in actually. 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?). 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. 14 "Hierarchical Builds".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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