[Scons-users] target-specific variables

Bill Deegan bill at baddogconsulting.com
Thu Feb 16 13:18:33 EST 2017


Stefan,

Yes.

env.SharedLibrary(target,sources, CPPDEFINES=...)
You can add any Envinronment() variable to any builder and it's scope is
limited to that builder.

You can see this in the manpage (and likely in the users guide as well)

It is possible to override or add construction variables when calling a
builder method by passing additional keyword arguments. These overridden or
added variables will only be in effect when building the target, so they
will not affect other parts of the build. For example, if you want to add
additional libraries for just one program:

env.Program('hello', 'hello.c', LIBS=['gl', 'glut'])

or generate a shared library with a non-standard suffix:

env.SharedLibrary('word', 'word.cpp',
                  SHLIBSUFFIX='.ocx',
                  LIBSUFFIXES=['.ocx'])


-Bill



On Thu, Feb 16, 2017 at 9:07 AM, Stefan Seefeld <stefan at seefeld.name> wrote:

> Hello,
>
> I have some build logic that does builds a shared library:
>
>   env.AppendUnique(CPPDEFINES=...)
>
>   env.SharedLibrary(...)
>
>
> Is there a simple way to append to CPPDEFINES only in the scope of the
> SharedLibrary object ? If I pass the CPPDEFINES keyword argument to the
> SharedLibrary() call, it will override all previous values. Is there a
> way to append to the existing list instead ? Or do I need to clone the
> entire environment for this ?
>
>
> Thanks,
>
>         Stefan
>
> --
>
>       ...ich hab' noch einen Koffer in Berlin...
>
> _______________________________________________
> 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/20170216/f0055e2d/attachment.html>


More information about the Scons-users mailing list