I am trying use cl
from Visual Studio 2010 to build the 32-bit version of Mixxx. Mixxx uses SCons to build. My computer is Windows 7 64-bit with too many versions of Visual Studio installed.
Following these instructions, I have tried all sorts of combinations and variations of setenv
and vsvars
but no matter what I do, I end up on the command line in this situation:
> cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
OK, so cl
is pointing to "version 16, x86" - great.
> scons toolchain=msvs force32=1 winlib=%cd%\winlib\x86 sqlitedll=0 staticlibs=1 asmlib=0
[... bunch of output truncated, until we start using the compiler ...]
cl /Fores\qrc_mixxx.obj /c res\qrc_mixxx.cc /TP /Zc:wchar_t- /GL /MP /fp:fast /G
[truncated]
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
(Note - I hacked SCons to remove the /nologo
) What? How does cl
now mean "version 18, x64"? Did it change my environment? Let's find out:
Terminate batch job (Y/N)? y
>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
So cl
still means "version 16, x86" to the terminal. But SCons always uses "latest version, x64".
(Based on my understanding of the Windows shell, this should not even be possible. I killed the script, so it didn't do any cleanup. How can the meaning of cl
change like that?)
I've found a couple hints:
- http://scons.1086193.n5.nabble.com/Using-32-bit-MSVC-compiler-on-64-bit-Windows-td28062.html
- http://www.scons.org/wiki/MsvsMultipleVersions
- Forcing scons to use older compiler?
Based on this, I've added
Environment(MSVC_VERSION = '10.0')
Environment(TARGET_ARCH = 'x86')
print 'hello world'
to the SConstruct. I don't know SCons, and the build scripts are non-trivial, so it's likely that I'm doing this wrong. Regardless, SCons still always uses "newest version, x64".