[Scons-users] Specify Toolchain for Windows

Zarko Berberski (Aditi Staffing LLC) v-zaberb at microsoft.com
Thu May 18 15:03:29 EDT 2017


Are you launching scons.py from some command shell/script ? 

The setup I'm working with uses cygwin64 and the build script adds "C:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin" (and the whole slew of others) so scons.py already has it and doesn't need build. 

When I need to invoke scons.py standalone (like form a debugger) I inject a file by adding something like:

Import os, sys
SconsStarter = os.path.join( os.path.dirname(__file__), "SconsStarter.py")
execfile(SconsStarter)

to the very beginning of scons.py and SconsStarter.py adds all paths I need, like:
----------------------------------------------------------------------------
BuildRoot = r"C:\cygwin64\home\v-zaberb"

BuildPath = [ 
              r"C:\ocamlmgw64\bin", 
              r"C:\PROGRA~2\MICROS~1.0\VC\bin\amd64", 
              r"C:\PROGRA~2\MICROS~1.0\VC\bin", 
              r"C:\PROGRA~2\MICROS~4\F#\4.0\FRAMEW~1\v4.0/", 
              r"C:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin" 
]

SconsPath = [ join(sys.prefix, 'scons'),    # throwaway, scons.py eats sys.path[0]
              join(sys.prefix, 'Lib', 'site-packages', 'scons-2.5.0'), 
              join(sys.prefix, 'Lib', 'site-packages', 'scons-2.5.0', 'scons')
              ]

sys.path = SconsPath + BuildPath + sys.path
----------------------------------------------------------------------------

Oh and you do need to put one extra path at the top of your sys.path since scons.py is just going to eat it :-) Not kidding:

https://bitbucket.org/scons/scons/src/f34900d9bfd84fd3c44ebe5763dfad0e8bb1e247/src/script/scons.py?at=default&fileviewer=file-view-default#scons.py-68


-----Original Message-----
From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of R0b0t1
Sent: Wednesday, May 17, 2017 10:32
To: SCons users mailing list <scons-users at scons.org>
Subject: Re: [Scons-users] Specify Toolchain for Windows

On Wed, May 17, 2017 at 11:50 AM, Bill Deegan <mailto:bill at baddogconsulting.com> wrote:
> Are you using:
> Program()
> or environ.Program() ?
>
> -Bill
>

My apologies, I'm using `environ.Program()` as above:

```Python
shooter = environ.Program(target=target, source=sources,
    PATH=path, LIBS=libraries, CPPPATH=incpath, LIBPATH=libpath) ``` _______________________________________________
Scons-users mailing list
mailto:Scons-users at scons.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist4.pair.net%2Fmailman%2Flistinfo%2Fscons-users&data=02%7C01%7Cv-zaberb%40microsoft.com%7C1068f1ecc49c435a4d8808d49d4ab36d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636306391545809523&sdata=hOB6B6XhQrx%2FPYphjWfJYsj2rSMhdwwzgb80FPmXL24%3D&reserved=0


More information about the Scons-users mailing list