Forcing scons to use older compiler?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 21:58:16

问题


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?


回答1:


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.




回答2:


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

env = Environment(CXX = "C:\\path\to\vs2008\executable")


来源:https://stackoverflow.com/questions/3079344/forcing-scons-to-use-older-compiler

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!