[Scons-users] Path expansion with multiple SConscripts

Bill Deegan bill at baddogconsulting.com
Thu Dec 8 20:22:22 EST 2016


Eric,

It's python so you could always monkey patch the behavior in.
That said, I wouldn't recommend it.

Seems like something similar to '#' might be right for this.
The usual way folks implement this is:

env.Append(CPPPATH=['#/path/to/real/source'])

So you're looking for more flexibility than that...

Or similar to:

${SOURCE.rsrcdir}    => /usr/repository/src

But in your context SOURCE isn't defined...

-Bill



On Thu, Dec 8, 2016 at 5:00 PM, Eric Lunderberg <eric.lunderberg at gmail.com>
wrote:

> I have something of a work-around at the moment.  Instead of using
> env.Append(CPPPATH=['.']) or env.Append(CPPPATH=[Dir('.')]), I can use
> env.Append(CPPPATH=[Dir('.').RDirs('.')]).  This forces the expansion of
> '.' to be done immediately, while still in the bottom-level SConscript, and
> expands to both the source directory and the variant directory.
>
> Is there a way to set this as the default behavior from the top-level
> SConstruct?  It seems like a bit of an awkward work-around at the moment,
> needing to remember to do so in each SConscript.
>
>
> On Mon, Dec 5, 2016 at 3:44 PM, Eric Lunderberg <eric.lunderberg at gmail.com
> > wrote:
>
>> Hello,
>>
>> I believe I have run into a bug involving the include path generated for
>> C++ compilation.  I am attempting to set up a modular SConstruct to compile
>> multiple shared libraries, some of which depend on the others.  When a
>> SConscript adds the current directory to the CPPPATH of a shared
>> environment, the "." is expanded to the directory of the SConscript that
>> defines a compilation rule, rather than the SConscript that appended to the
>> CPPPATH.
>>
>> This becomes an issue when using variant_dir and duplicate=False, because
>> it becomes impossible to use the Dir('.') syntax to force an early
>> expansion of the directory.  In this case, it resolves to a path to the
>> variant_dir, rather than expanding to both the variant_dir and location of
>> the SConscript, as usually happens when using duplicate=False.
>>
>> The directory structure, contents of the SConstruct and SConscript, and
>> resulting error messages are shown here (http://pastebin.com/mpBWvEQG).
>> A short discussion of this issue can be found here
>> <http://stackoverflow.com/q/40424482/2689797> on stack overflow, where
>> it was suggested that the bug report be brought to the mailing list.
>>
>> Thank you,
>> Eric Lunderberg
>>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20161208/d8d41af6/attachment.html>


More information about the Scons-users mailing list