[Scons-users] Retrieving variables

Stefan Seefeld stefan at seefeld.name
Fri Jun 17 14:27:12 EDT 2016


On 17.06.2016 14:14, Bill Deegan wrote:
> Is there a msvc.pyc or .pyo still in your config dir?

I'm not quite sure what the problem was, but after some further
refactoring the symptom has disappeared. SCons is now correctly looking
for tools both in my custom path as well as the builtin path(s).

I'm still trying to figure out how to conditionalize the call to

  env.Tool('msvc')

The obvious check is for the platform ('win32'). But even there, not all
Windows users have MSVC installed, so how can I reproduce the SCons
logic of iterating over a list of tools until one is found ?

In fact, what I really want is this:

For each platform, find all available tools, then let the user pick. For
example, on Linux:

*  `scons` should pick gcc
*  `scons toolchain=clang` should pick clang
*  `scons toolchain=msvc` should fail ("no such toolchain")

On Windows:

* `scons` should pick msvc if available, or any other of the default
tools being searched for
* `scons toolchain=cygwin` should pick the cygwin compiler (if available)
* etc.

Any suggestion on how to implement that logic ?

Many thanks for all your help !

        Stefan


-- 

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



More information about the Scons-users mailing list