Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
609 views
in Technique[技术] by (71.8m points)

c++ - Can I set the platform toolset from the command line when building with VS2010's msbuild?

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);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Yes you can set PlatformToolset without change the vcxproj file.

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.

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...