使用VS2010的msbuild进行构建时,可以从命令行设置平台工具集吗? [英] Can I set the platform toolset from the command line when building with VS2010's msbuild?
问题描述
当我从命令行使用msbuild构建VS2010时,是否可以从命令行将平台工具集更改为v90(即Visual Studio 2008工具链),而无需编辑vcxproj文件?
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);
推荐答案
是的,您可以设置PlatformToolset而无需更改vcxproj文件.
Yes you can set PlatformToolset without change the vcxproj file.
如果打开vcxproj文件,则会看到存在PlatformToolset
属性.
对于Visual Studio 2012,它是v110;对于Visual Studio 2012,它是v110.对于VS2010,它是v100;对于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屋!