tags:

views:

47

answers:

2

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 when it is debugging an executable, but I doubt I'd get any answers.)

+1  A: 

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.

Ross Rogers
+1  A: 

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

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