[Scons-users] Code generation and VariantDir?

Dirk Bächle tshortik at gmx.de
Mon Apr 28 17:42:35 EDT 2014


On 28.04.2014 23:24, Jason Fritz wrote:

> Hi Dirk,

>

> Thanks so much for your time/attention on this!

>

You're welcome.


> The setup you sent me has one serious difference from my setup: the

> auto-generated foo.h gets copied to the variant directory. In my

> setup, the .h is generated within the same dir as the .tsn. The

> reason I'm doing it this way is for legacy reasons: I'm converting an

> old recursive Makefile-based build system into SCons, and there are

> hundreds of directories that are importing the header files from

> existing source dirs. I suppose I could re-work the build system to

> put the generated source under the variant dirs if necessary, but

> would prefer not to.

>

> Is there an easy way to get the .h file into the same dir but have the

> .o files go into the variant dirs?

>

Can't think of anything simple right now. But if you specify the header
include paths via CPPPATH, relative within each SConscript, they should
automatically get expanded for the variant dirs by prepending the output
directory to each "-I" option. Like this, your header files should get
found even when created in "debug"/"release", and you have a clear
separation between inputs and outputs.
Wouldn't that do?

Dirk



More information about the Scons-users mailing list