Can I set the platform toolset from the command line when building with VS2010#39;s msbuild?(使用 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 构建时,我可以从命令行设置平台工具集吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 VS2010 的 msbuild 构建时,我可以从命令行设置平台工具集吗?


基础教程推荐
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 我有静态或动态 boost 库吗? 2021-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01