build - SCons:清理失败后重建
问题描述
我正在尝试这个例子:https ://bitbucket.org/Ateru/build-systems/src/default/scons/
我修改了SConstruct
文件以设置构建目录:
SConscript(
'statlib/SConscript',
variant_dir='build/statlib',
duplicate=0
)
SConscript(
'dynlib/SConscript',
variant_dir='build/dynlib',
duplicate=0
)
SConscript(
'executable/SConscript',
variant_dir='build/executable',
duplicate=0
)
第一次构建成功。
但是,构建之后scons --clean
和构建scons --no-cache
失败,导致 SCons 使用了错误的文件路径tablegen.py
。
修改后的例子:scons.zip
解决方案
如果您将示例文件 statlib/SConscript 更改为:
import os
# This is needed so we get the python from PATH
env = Environment(ENV = os.environ)
env.Append (CPPPATH='#')
pyexec = 'python' if os.name == 'nt' else 'python3'
env.Command ('table.cpp', 'tablegen.py', '{} $SOURCE > $TARGET'.format (pyexec))
env.StaticLibrary('statlib', [
# This adds fPIC in a portable way
SharedObject ('StaticLibrarySource.cpp'),
SharedObject ('table.cpp')])
它应该工作。
注意:我已经针对您指定的回购提出了问题。 https://bitbucket.org/Ateru/build-systems/issues/2/youre-statlib-sconscript-has-issue-which
推荐阅读
- c# - 无需用户输入密码的无头 UWP 蓝牙配对
- java - 由于某种原因无法调用方法
- node.js - Node.js 更改已运行子进程的 stdio(取消引用它)
- c++ - 使用指针交换整数
- arrays - Swift:编写将从数组中调用随机项而不再次调用该项的代码
- python - 如何使用 pymel(或 maya.cmds)将自定义 UVset 中的 UV 链接到 Maya 中的纹理
- python - 如何有效地组合许多 numpy 数组?
- typescript - Ionic 3如何接收从一页到另一页的数组
- azure-devops - Azure DevOps:如何在拉取请求完成后触发发布?
- sql - SQLite 查询时间的差异