[Scons-users] Scons not using MinGW to build although being told to

Andreas Krügersen a.kruegersen at web.de
Wed Dec 17 17:26:54 EST 2014


Hi,

I've tried to set up a simple Hello World style SConstruct on Win 8.1 
with multiple versions of Visual Studio installed, along with a working 
MinGW installation. I want to use MinGW for my project so I set up my 
SConstruct as follows:

--------------------------------
env = Environment(tools=[])
env.Tool('mingw')
#print env.Dump()
Program('hello.cpp')
--------------------------------

The program is compiled, but instead of MinGW it uses the MSVC 
toolchain:

--------------------------------
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cl /Fohello.obj /c hello.cpp /TP /nologo
hello.cpp
link /nologo /OUT:hello.exe hello.obj
scons: done building targets.
--------------------------------

Now the interesting thing is that when I dump the environment by 
removing the comment in front of the print, CXX actually is set to g++ !

--------------------------------
scons: Reading SConscript files ...
{ [...]
  'CC': 'gcc',
  'CCCOM': '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES',
  'CCFLAGS': ['/nologo'],
[...]
  'CXX': 'g++',
[...]
--------------------------------

So how can it be that the environment is set up correctly but when it 
actually tries to build something it uses a completely different one?

Note that my MinGW, Python and SCons installations work fine. I can 
invoke g++ from cmd.exe, scons.bat obviously works fine as well.

Or do I have to build from the MinGW shell explicitly?



More information about the Scons-users mailing list