Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forcing scons to use older compiler?

Tags:

python

scons

I have a C++ project which is using boost. The whole project is built using scons + Visual Studio 2008. We've installed Visual Studio 2010 and it turned out scons was attempting to use the later compiler instead of the old one - and failed to build the project as boost and visual studio 2010 don't like each other very much - yet. We'd like to suppress this and force scons to use the 2008 version. Is this possible? How do we do this?

like image 272
Maciek Avatar asked Jun 20 '10 13:06

Maciek


2 Answers

You can modify the scons Environment() by just choosing the version you want:

env = Environment(MSVC_VERSION=<someversion>)

From the scons manpage:

MSVC_VERSION Sets the preferred version of Microsoft Visual C/C++ to use.

If $MSVC_VERSION is not set, SCons will (by default) select the latest version of Visual C/C++ installed on your system. If the specified version isn't installed, tool initialization will fail. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. Set it to an unexpected value (e.g. "XXX") to see the valid values on your system.

like image 146
dantje Avatar answered Nov 01 '22 14:11

dantje


You'll need to redefine the CXX construction variable, ideally in your Environment:

env = Environment(CXX = "C:\\path\to\vs2008\executable")
like image 21
Meredith L. Patterson Avatar answered Nov 01 '22 15:11

Meredith L. Patterson