我想爲我的項目使用scons。我見到目前爲止如下:建立一個目錄以外的'src'與scons不復制dep到variant_dir
SConstruct
path = ['/usr/local/bin', '/usr/bin', '/bin']
libpath = ['/usr/local/lib', '/usr/lib', '/lib']
env = Environment()
env.Append(ENV = {'PATH' : path})
env.Append(DFLAGS = ['-version=placeholder', '-g'])
env.Append(LIBPATH = libpath)
env.Append(DPATH = '#/build_debug/')
Export('env')
env.SConscript('src/SConscript', variant_dir = 'build_debug',
exports = {'DFLAGS' : '-debug'})
的src/SConscript
Import('env')
env.Program(target = 'a.out',
source = ['stubs.d'] + Glob('*/*.d'))
當試圖建立,但是,它給:
build_debug/foo/foo.d:9: Error: module bar is in file 'bar/bar.d' which cannot be read
檢查ls build_debug
顯示,並非所有文件都被複制過。
我認爲我早些時候工作過;但從那以後我肯定會搞砸了。我所有的源代碼都在project/src /中,我希望build/project在build/build中發生。我的SConstruct文件位於project /中。
但我的印象是,variant_dir點是建立一個不是源代碼樹以外的目錄下?並感謝LIBPATH的事情。 – Infiltrator
@Infiltrator,聽起來像我們需要澄清這一點。 SCons只支持構建與根SConstruct相同的子目錄結構的源代碼,同樣也與variant_dir的位置相同。通常情況下,源外指的是將variant_dir指定爲SConstruct下的目錄*** not ***。你想要做什麼? – Brady
那麼也許我誤用了我的術語;我會更新這個問題來澄清。 – Infiltrator