开发者

scons: foiling an IDE when using alternate build directories

So I have scons working with an alternate build location (build/ for my output files, src/ for my input files) and it works great. Except for one thing.

I'm using an IDE (TI Code Composer 4) to debug my program. I point the IDE at the output executable to run it, and what it uses for the source files for debugging is the build/ directory. I don't really care, except when I go to edit the file in the IDE, for example main.cpp, the file is really build/main.cpp which gets clobbered as soon as I run scons again. I have to remember to edit src/main.cpp instead. I am aware of this issue and yet I make the same mistake often.

Is there a way to have scons make the source files it copies into the build path read-only? (I'd ask how to get TI CCS4 to use the right source files开发者_如何学C when it is debugging an executable, but I doubt I'd get any answers.)


This page has information about wrapping InstallTargets with a chmod call.

FYI, the scons user list is quite active with many knowledgeable people and you can get answers pretty quickly.


You could always tell scons not to duplicate source files in the build directory:

SConscript('src/SConscript', variant_dir='build', duplicate=0)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜