build - scons env.InstallAs() 似乎没有复制任何文件?
问题描述
例如,我有一个 .c 文件,如下所示:
$猫你好.c
int main(){
return 0;
}
然后我使用 scons 构建并将其复制到某个地方:
$cat SConstruct
import os,sys
env = Environment()
hello = env.Program('hello.c')
env.InstallAs('/home/admin/hello-new', hello)
在名为“admin”的用户下运行 scons,它会打印:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o hello.o -c hello.c
gcc -o hello hello.o
scons: done building targets.
然后我尝试“ls /home/admin”,没有像“hello-new”这样的东西。所以我想知道为什么我的“env.InstallAs()”能正常工作?如何进行故障排除和修复?
谢谢。
解决方案
请阅读常见问题解答,这是对 SCons 的常见误解,因此在常见问题解答中:
随着您的示例更改为此应该会导致它始终构建有问题的目标:
import os,sys
env = Environment()
hello = env.Program('hello.c')
install_target = env.InstallAs('/home/admin/hello-new', hello)
# Always build the install target by default
Default(install_target)
推荐阅读
- html - 如何使用ffmpeg使html5 webm视频流畅滚动
- android - 在 for 循环中检索可绘制对象的资源 ID
- python - 查找浮点数是否在python中的两个浮点数之间
- svg - 如何在 jsf 中忽略 svg 命名空间警告
- python - 如果它们的类型和内容相同,为什么列表会彼此不同?
- sql - SQL:将 case 表达式中的值用于下一列
- javascript - 当 `li` 悬停时,使用 JavaScript 更改 `div` 宽度
- mysql - 来自json数组的MySQL条件过滤器元素
- optimization - 用于预乘 ARGB 的 SSE alpha 混合
- apache-nifi - NiFi:等待通知无限期等待问题。查看分布式地图缓存的内容?