使用 VS2010 的 msbuild 构建时,我可以从命令行设置平台工具集吗? [英] Can I set the platform toolset from the command line when building with VS2010's msbuild?

查看:29
本文介绍了使用 VS2010 的 msbuild 构建时,我可以从命令行设置平台工具集吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从命令行使用 msbuild 构建 VS2010 时,我可以在不编辑 vcxproj 文件的情况下从命令行将平台工具集更改为 v90(即 Visual Studio 2008 工具链)吗?

When I'm building a VS2010 with msbuild from the command line, can I change the platform toolset to v90 (i.e. Visual Studio 2008 toolchain) from the command line, without editing the vcxproj file?

我目前在构建脚本中使用以下命令行:

I'm using the following command line in my build script currently:

mysystemf("msbuild %s.vcxproj /t:rebuild /p:configuration=release,platform=%s", prjname, platform);

推荐答案

是的,您可以在不更改 vcxproj 文件的情况下设置 PlatformToolset.

Yes you can set PlatformToolset without change the vcxproj file.

如果您打开一个 vcxproj 文件,您会看到有一个 PlatformToolset 属性.对于visual studio 2012,它是v110;对于VS2010,是v100;VS2008 为 v90.

If you open a vcxproj file, you'll see that there is a PlatformToolset property. For visual studio 2012, it is v110; For VS2010, it is v100; For VS2008, it is v90.

您可以使用 /p:PlatformToolset=v110/v100/v90 覆盖此属性以更改工具链.

You could overwrite this property with /p:PlatformToolset=v110/v100/v90 to change the toolchain.

注意:有时,msbuild 失败并返回错误 Unsupported platformtoolset value,这主要是因为您没有指定 VisualStudioVersion.

Note: Sometimes, msbuild failed with error Unsupported platformtoolset value, it is mostly because you have not specify the VisualStudioVersion.

这篇关于使用 VS2010 的 msbuild 构建时,我可以从命令行设置平台工具集吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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