【发布时间】:2015-09-28 04:08:52
【问题描述】:
我有一个类似这样的代码sn-p:
# Compile protobuf headers
env.Protoc(...)
# Move headers to 'include' (compiled via protobuf)
env.Command([include headers...], [headers...], move_func)
# Compile program (depends on 'include' files)
out2 = SConscript('src/SConscript')
Depends(out2, [include headers...])
基本上,我有Protoc() 编译protobuf 文件,然后将头文件通过env.Command() 移动到'include' 目录,最后通过'src' 中的SConscript 文件编译程序。
由于这些是正在移动的头文件(src 编译所依赖的),它们没有被 scons 明确定义为依赖项(据我所知)。因此,编译运行,但头文件没有被移动,所以它失败了。我尝试通过Depends() 和Requires() 暴露依赖,但没有成功。
我知道在通常情况下,scons 应该“找出”依赖关系,但我不知道它在这里如何做到这一点。
谢谢!
【问题讨论】:
标签: scons