How to handle building files outside of directory

£可爱£侵袭症+ 提交于 2019-12-13 07:15:57

问题


I have a build set up and I'm struggling on how to handle one aspect. I have successfully setup a variantdir for my project folder src build output, however I have source that resides outside the project folder that needs to be build and included.

I am able to add the files I need into the build, however the object files are put into the external directory where the library souce files are.

Is there a standard way to solve this. I would like to avoid adding any scons files to the external directory as it is a standard intall of a tool.

What I attempted was to Mkdir() a temporary folder, Copy() the files, and build the files. This seems to work, but only the first time as the file permissions are set to readonly. Also, the only way to get it to work seemed to be to use the Execute() command which caused the action to happen at every build.


回答1:


Have a look at the Repository() method (see http://scons.org/doc/production/HTML/scons-user.html#chap-repositories in the SCons UserGuide). It lets you sort of "mount" a folder to the top-level of your source tree. Then you can refer to them locally, and specifying "duplicate=1" for your variant dir should keep your remote folder clean from built files. Hope this helps...




回答2:


I was able to get the functionality I was looking for by building the objects in the external directory and then using the Move() Factory to move the object files.

If Anyone can point out a more 'scons'sy way of doing it please let me know.



来源:https://stackoverflow.com/questions/27747512/how-to-handle-building-files-outside-of-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!