[Scons-users] Help my build get faster... (was SCons and parts)

Bill Deegan bill at baddogconsulting.com
Fri Aug 18 10:23:53 EDT 2017


Works on all builders.

It's in the manpage:

http://scons.org/doc/production/HTML/scons-man.html

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'])

(Note that both the $SHLIBSUFFIX and $LIBSUFFIXES variables must be set if
you want SCons to search automatically for dependencies on the non-standard
library names; see the descriptions of these variables, below, for more
information.)


-Bill

-Bill

On Fri, Aug 18, 2017 at 10:14 AM, Mats Wichmann <mats at wichmann.us> wrote:

> On 08/15/2017 08:56 PM, Bill Deegan wrote:
> > Pico,
> >
> > You can do this.
> >
> > env.MyBuilder(Target,Source, ANY_ENV_FLAG=['a','b','c'],
> > CPPPATH=['z','d','f']
> > There's no need to clone the environment to have specialized flags for a
> > given builder or target..
>
> we have a lot of Clone()s (180 at the moment) so I'd like to look into
> this... the pain is in separating things for different uses, like
> building a shared library wants one set of things to link with, a unit
> test another (it's the only one that wants to link with gtest, which
> this project uses), an example app using the lib wants another set.
> Because of trouble getting things working, those tasks have often been
> divided into subsidiary sconscripts, each of which then does a clone and
> builds up its own env, which seems to me a bit overkill to me.
>
> I haven't seen the above possibility listed in the docs, am I just
> missing something? Applies to the Program builder, not just custom ones?
>  What I actually want is not SOMEVAR=[mylist], but to add (say) one more
> element to the existing SOMEVAR just for that builder invocation. That
> works?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170818/6c2800d9/attachment.html>


More information about the Scons-users mailing list