scons - 总是在构建后安装 [英] scons - always install after build
问题描述
我希望 scons 总是在几个附加目录中安装构建的文件.
I want scons to always install the built file in several additional directories.
我使用用户手册中显示的别名创建了通常的安装构建器,当我使用 scons install
时它可以正确安装,但我更喜欢它在目标构建后自动运行,我不知道如何指定依赖项.
I created the usual install builder with alias a shown in user manual and it installs correctly when I use scons install
but I prefer it to run automatically after the target is built and I cannot figure out how to specify the dependencies.
Target = Program(...)
Env.Alias('install', Env.Install(FinalDir, Target))
目标应该依赖于安装还是反之亦然,还是我应该使用其他东西?
Should the target depend on install or vice versa or should I use something else?
推荐答案
我在定义 install
目标并试图弄清楚如何自动运行它时走错了路.
I went the wrong way of defining install
target and trying to figure out how to run it automatically.
我通过将安装构建器别名为我想要安装的真实文件名而不是 install
解决了这个问题.
I solved it by aliasing the Install builder to the real file names I wanted to install instead of install
.
Env.Alias('/some/dir/filename', Env.Install('/some/dir', Target))
这篇关于scons - 总是在构建后安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!