六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 33|回复: 0

scons 的注意点

[复制链接]

升级  52.67%

35

主题

35

主题

35

主题

秀才

Rank: 2

积分
129
 楼主| 发表于 2013-1-15 02:48:16 | 显示全部楼层 |阅读模式
mail scons --silent

总结一下 scons 的注意点。

1. target , source
   scons 缺省认为是 [file,file] list.
   如果是dir 需要 [Dir(dd),Dir(ee)) ] ,

   这个 Dir(ddd) 的类型是 SCons.Node.FS.Dir ,可以用 str( ) 转为str

   否则报 ,lookup file , dir  ............错误

2. scons 的路径缺省是 variant dir  ,比如'#build'
   子目录下的 缺省路径是 variant dir / sub dir

os.path.join (parant,'/dir') 将产生 '/dir' ,这也许不是想要的结果

3。alias 不能被 Depends
4。--debug = pdb, explain ,stacktrace 可以帮助查错

5. Install , 与InstallAs 不能成功的原因,就是因为 路径拼错了
6。Tar 会连同 dir 打包  ,如果不需要 dir 需要自己写 Command 才可以

7。psedu Builder 比Builder 方便, 可以多传参数

8。避免硬编码, 以方便以后维护
9. compressed tar 不能 update
10. SconsEnvironment 位于 module ,Scons.Script.SconsScript ,而不是Scons。Environment
11. 轻易不要使用 shell command ,否则 目录关系会很烦
12. filegenerator is stupid than tar
so many call ,it's fool for a architect.
13. tar Flag should be set with Replace other than append
14. If you need operate os path. should env.Dir(path).abspath
15. env.Execute(Mkdir(paht)) can execute imediataly.

16. psedo builder  combine other builders , os operation will executed during scan process ,It's path will be wrong ,since file in variant build path is not   set up properly
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表