[Scons-users] Export command and CPPPATH concatenation
Dirk Bächle
tshortik at gmx.de
Fri Jan 31 17:12:35 EST 2014
Hi Laurent,
On 31.01.2014 22:30, Laurent wrote:
> Hello,
>
> I recently discover a rather strange behavior of scons using the
> Export/Import mechanism for sharing Environment between two
> SConstruct. I appears that the CPPPATH is appended with the build
> directory but as a string and not as an array resulting in incorrect
> include paths.
>
> Here is an example:
>
> [...]
>
> Why is scons appending the CPPPATH defined in the SConstruct as a
> string (resulting in './A/A/B') in the SConscript and not as a list
> (resulting in ['./A', './A/B']) ? Is this the regular behavior of scons ?
>
in your example I don't see where you try to add "./A" to CPPPATH.
Please check, and repost your sources if necessary.
From your description I can only guess that you wrote something like
env = Environment(CPPPATH='./A', ...)
which sets CPPPATH to a string. Then, if you later try to add your
"[./A/B]" the AppendUnique() automatically converts the list to a string
and appends it (because it is already a string, the new values get
converted to match).
When specifying path variables you should always use list notation:
env = Environment(CPPPATH=['./A'])
Please also have a look at the thread
http://four.pairlist.net/pipermail/scons-users/2013-September/001713.html
Best regards,
Dirk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140131/cb37ddb8/attachment.htm
More information about the Scons-users
mailing list