1
我想在一個子目錄中構建所有的.c文件。我想我會做這樣的事情:scons:使用glob可以很好地構建目錄
src/foo/SConscript
包含:
import glob;
here = Dir('.');
sourcefiles_raw = glob.glob(here.path+'/*.c');
print(sourcefiles_raw);
# print them for debugging
# ... then build them (in the process, making scons aware of dependencies)
src/SConscript
包含:
SConscript(['foo/SConscript']);
SConstruct
包含:
SConscript(['src/SConscript'],build_dir='build');
但它打印[]
,因爲glob.glob()
在scons可以決定哪些源文件需要從src/foo
複製到build/foo
之前運行在目錄build/foo
中。
我該如何解決這個問題?