[Scons-users] Retrieving variables

Jason Kenny dragon512 at live.com
Fri Jun 17 15:33:45 EDT 2016


I have this already in Parts.

 

I add a –toolchain argument that allow a given tool chain to be loaded.

 

Ie you say:

 

#get latest gcc on system

Scons --toolchain=gcc

 

#get latest cl (msvc) on system

Scons --toolchain=cl

 

#get latest cl version 10 on system

Scons --toolchain=cl_10

 

#get latest gcc version 3.9.x on system

Scons --toolchain=gcc_3.9

 

If you don’t like the toolchains defines by Parts you can define you own.

 

You could easily define a toolchain and configuration set to have Parts auto select the correct compiler and flags based on the os, architecture and version of python found on the system

 

You don’t have to use the “component” Part() feature to get this to work.

 

Jason

 

 

From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of Daniel Holth
Sent: Friday, June 17, 2016 2:25 PM
To: SCons users mailing list <scons-users at scons.org>
Subject: Re: [Scons-users] Retrieving variables

 

I am working on slurping all the compiler arguments from distutils into scons for Python extensions. Anyone else tried it?

 

On Fri, Jun 17, 2016, 14:46 Ganssauge, Gottfried <Gottfried.Ganssauge at haufe-lexware.com <mailto:Gottfried.Ganssauge at haufe-lexware.com> > wrote:

You could use distutils.
That has the advantage that it gets you the right msvc for python builds.

Cheers,
Gottfried

-----Ursprüngliche Nachricht-----
Von: Scons-users [mailto:scons-users-bounces at scons.org <mailto:scons-users-bounces at scons.org> ] Im Auftrag von Stefan Seefeld
Gesendet: Freitag, 17. Juni 2016 20:27
An: scons-users at scons.org <mailto:scons-users at scons.org> 
Betreff: Re: [Scons-users] Retrieving variables

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...

_______________________________________________
Scons-users mailing list
Scons-users at scons.org <mailto:Scons-users at scons.org> 
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
Scons-users at scons.org <mailto: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/20160617/3388a08c/attachment.html>


More information about the Scons-users mailing list