[Scons-users] caching build parameters

Stefan Seefeld stefan at seefeld.name
Fri Jun 10 09:58:28 EDT 2016


Hello,


I'm working on a project whose build process is highly configurable.
Having used the GNU autotools a lot in the past, I'm very used to a
process where all the build parameters are captured during a 'configure'
step, so any subsequent `make` invocation would pick them up from
generated makefiles and headers.


Now I'm trying to get that functionality with SCons. My command-line
contains a mix of variables and options:

    scons --python=... --boost-prefix=... variant=release arch=x86_64


and I would like to separate the 'configure' step from subsequent
'build', 'test', etc. targets, so I could run


    scons config --python=... --boost-prefix=... variant=release arch=x86_64

    scons

    scons check

    scons install


Some of the above appears to be supported using


    vars = Variables('config.py', ARGUMENTS)

    ...

    vars.Save('config.py', env)


but not all: this only remembers "variables", not "options". In
addition, for variables to be remembered, I need to explicitly 'Add'
them, which makes them public (i.e., `scons -h` will report them).

This raises two questions:

1) is there a way to cache both variables as well as options ?

2) is there a way to distinguish 'public' variables from those that are
computed as part of the configure process, so `scons -h` doesn't
advertise them ?


Thanks,

        Stefan


-- 

      ...ich hab' noch einen Koffer in Berlin...



More information about the Scons-users mailing list