如何处理目录外的构建文件 [英] How to handle building files outside of directory

查看:52
本文介绍了如何处理目录外的构建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个构建设置,但我正在努力解决一个方面的问题.我已经成功地为我的项目文件夹 src 构建输出设置了一个变体目录,但是我有位于需要构建和包含的项目文件夹之外的源.

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.

有没有标准的方法来解决这个问题.我想避免将任何 scons 文件添加到外部目录,因为它是工具的标准安装.

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.

我尝试的是 Mkdir() 一个临时文件夹, Copy() 文件,然后构建文件.这似乎有效,但只是第一次将文件权限设置为只读.此外,让它工作的唯一方法似乎是使用 Execute() 命令,该命令导致每次构建时都发生该操作.

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.

推荐答案

看看 Repository() 方法(见 http://scons.org/doc/production/HTML/scons-user.html#chap-repositoriesSCons 用户指南中).它允许您将文件夹挂载"到源代码树的顶层.然后您可以在本地引用它们,并为您的变体目录指定duplicate=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...

这篇关于如何处理目录外的构建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆