【发布时间】:2018-12-21 04:54:35
【问题描述】:
即使在构建期间缺少某些 SConscript 文件,SCons 也会继续构建。例如,我有这样的源结构:
├── a
│ └── test1.c
├── b
│ ├── SConscript
│ └── test2.c
└── SConstruct
在 SConstruct 中,我正在调用两个 SConscript 文件,其中一个 SConscript 缺失。
SConscript('a/SConscript')
SConscript('b/SConscript')
运行“scons”命令时收到警告消息。
scons: Reading SConscript files ...
scons: warning: Ignoring missing SConscript 'a/SConscript'
File "/home/srbd/workspace/programming/scons_demo/SConstruct", line 1, in <module>
scons: done reading SConscript files.
scons: Building targets ...
gcc -o b/test2.o -c b/test2.c
gcc -o b/test2 b/test2.o
scons: done building targets.
但它显示整体 scons 构建已成功完成。
在我的真实系统中,我有很多源文件夹/文件,其中一些 SConscript 在构建时可能不存在。当整体构建显示成功时,仅通过警告消息很难注意到那些丢失的文件。
我在 scons 参数中搜索过,但没有找到有用的参数。
如果缺少 SConscript 之一并将构建显示为失败,我是否可以停止构建?
【问题讨论】: