[Scons-users] Code generation and VariantDir?

Jason Fritz jasonfritzpublic at gmail.com
Mon Apr 28 18:44:32 EDT 2014


On Mon, Apr 28, 2014 at 4:30 PM, Dirk Bächle <tshortik at gmx.de> wrote:


> On 29.04.2014 00:10, Jason Fritz wrote:

>

> On Mon, Apr 28, 2014 at 3:42 PM, Dirk Bächle <tshortik at gmx.de> wrote:

>

>> [...]

>

>

> This legacy build system is kind of messy, as I'm sure you can imagine.

> For example, one directory I've converted has a CPPPATH with 60 different

> entries. Each entry in CPPPATH is relative to the root dir, e.g.

> "#/src/autogen".

>

> That's a bad idea in general, you want the single SConscripts and

> their subfolders to be independent of their parents and relocatable as much

> as possible. This ensures that you're not running into any trouble, even

> when using variant dirs...and possibly combining them with "-j".

> Cleaning up your build a little will definitely pay off in the long run.

>


Sorry to beat this topic to death, but I'm not sure which part you think is
a bad idea. Are you saying that a CPPPATH entry like
"../../../src/autogen" is preferable to "#/src/autogen"?



> That would probably work (just like "duplicate=1", by the way). However,

> the approach above will even work if the contents of your header file (or

> any other file you auto-generate during the build) depend on the current

> environment. Depending on an environment variable or define, you might have

> to include additional headers or not...so you actually need two versions of

> your "*.h" file.

> So, by starting with a setup that might look a little over-engineered at

> first, you're pretty safe against changes and have a scalable build. And

> the costs for this aren't that high, I think.

>

> Just my 2 cents.

>


Those are good 2 cents :) Now I'm convinced to put the .h in the output
directory.

Thanks a lot!
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140428/d4b98b35/attachment.html


More information about the Scons-users mailing list