强制 scons 使用旧编译器? [英] Forcing scons to use older compiler?

查看:41
本文介绍了强制 scons 使用旧编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 boost 的 C++ 项目.整个项目是使用 scons + Visual Studio 2008 构建的.我们已经安装了 Visual Studio 2010,结果 scons 试图使用后来的编译器而不是旧的编译器 - 并且未能像 boost 和 Visual Studio 2010 don 那样构建项目不太喜欢对方 - 还没有.我们想抑制这个并强制 scons 使用 2008 版本.这可能吗?我们如何做到这一点?

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?

推荐答案

你可以修改 scons Environment() 只需选择你想要的版本:

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

env = Environment(MSVC_VERSION=)

env = Environment(MSVC_VERSION=<someversion>)

来自 scons 手册页:

From the scons manpage:

MSVC_VERSION 设置首选Microsoft Visual C/C++ 版本使用.

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

如果未设置 $MSVC_VERSION,则 SCons将(默认情况下)选择最新的安装的 Visual C/C++ 版本你的系统.如果指定版本未安装,工具初始化将失败.这个变量必须是作为参数传递给Environment() 构造函数;设置它后来没有效果.将其设置为要查看的意外值(例如XXX")系统上的有效值.

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.

这篇关于强制 scons 使用旧编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆