调试
在一个大型构建项目中,编写构建脚本可能会遇到各种问题,此时如果没有一个合适的 debug
方法,是会让开发人员 “发疯” 的,所以在 SCons
中提供了调试方法,可以指出当前正在做的工作,以及是否出现错误和错误类型与内容。
–debug=explain
Command('hello/hello_copy.c', 'hello/hello.c', Copy("$SOURCE", "hello/hello_ccccc.c"))
可以看到在使用 --debug=explain
前后,输出窗口有明显不同,添加上 --debug=explain
选项后,在需要复制的源文件不存在时,会进行说明,方便开发者在执行构建之后,对构建过程进行分析,定位问题。
admin@DESKTOP-NQU1HUV C:\Users\admin\Desktop\scons\day11
$ scons -Q -c && scons -Q
Copy("hello\hello.c", "hello/hello_ccccc.c")
scons: *** [hello\hello_copy.c] hello/hello_ccccc.c\*.*:
admin@DESKTOP-NQU1HUV C:\Users\admin\Desktop\scons\day11
$ scons -Q -c && scons -Q --debug=explain
scons: building 'hello\hello_copy.c' beca