SCons:使Substfile依赖于Install

时间:2019-02-05 17:25:02

标签: scons

我使用swig生成了一些csharp包装器,并将它们安装到目录中。
安装这些文件后,我想使用env.Substfilepublic enum替换internal enum
问题是,无论我设置Substfile依赖什么,它总是在安装包装程序之前执行

这是脚本的一部分:

install = Install(bins, wrapper_bins)
script_dict = {'public enum': 'internal enum'}
for f in Glob(wrapper_dir.abspath+'/*.cs'): # tried also without the filter
    sub = env.Substfile(f, SUBST_DICT = script_dict)
    Depends(sub, install)

如何确保仅在完成Substfile之后执行Install

这是更新的代码(仍然无效)

env['WRAPPER_DIR'] = "c:\\dev\\test\\"
script_dict = {'public enum': 'internal enum'}
for f in Glob(wrapper_dir.abspath+"/*"):
    sub = env.Substfile("${WRAPPER_DIR}/${SOURCE.file}", f, SUBST_DICT = script_dict)
    Depends(installed_bins, sub)

SCons版本3.0.1

1 个答案:

答案 0 :(得分:0)

尝试一下:

installed_bins = Install(bins, wrapper_bins)

env['WRAPPER_DIR']='some path'
script_dict = {'public enum': 'internal enum'}
for f in Glob(source_path_for_cs_s+"*.cs"):
    sub = env.Substfile("${WRAPPER_DIR}/${SOURCE.file}", f, SUBST_DICT = script_dict)
    depends(installed_bins, sub)