[Scons-users] Code generation and VariantDir?
Dirk Bächle
tshortik at gmx.de
Tue Apr 29 03:12:28 EDT 2014
On 29.04.2014 00:44, Jason Fritz wrote:
>
> On Mon, Apr 28, 2014 at 4:30 PM, Dirk Bächle <tshortik at gmx.de
> <mailto: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
>> <mailto: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"?
Yes, pretty much so. If I'm in the "src/autogen" folder anyway, I'd
always simply append "." to the CPPPATH. It looks very tempting to setup
an environment just once, not only the compiler flags but the include
paths too.
But it's better if you specify the minimum set of include folders for
CPPPATH, right in the SConscript of your sub-module. That's where
Clone()ing the environment from above comes into play. You want to have
things like the CXXFLAGS all throughout the targets that you create with
your release or debug environment, but you only need a certain amount of
header directories, lib search paths and libs (LIBS, LIBPATHS) for your
current library or program.
Dirk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140429/b676df9a/attachment.html
More information about the Scons-users
mailing list