简体   繁体   中英

How do I build all configurations of a Visual Studio 2008 C++ project on the command line?

I'd like to build all the configurations of a VS 2008 C++ project on the command line. Something like:

devenv TheProject.vcproj /build /nologo

But this doesn't work because the /build command insists on having a configuration following it like this:

devenv TheProject.vcproj /build "Release|Win32" /nologo

Is there a way to get a command line build of all configurations within the vcproj file?

I was thinking you can do what you want with MSBUILD, but it appears that it isn't much better for this than DEVENV.

You still have to specify each configuration on the command line, although it would be easy to write a batch file to accomplish this with either MSBUILD or DEVENV.

It looks like previous versions of the development environment may have supported an "ALL" option, but VS 2008 does not.

http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/8701b3d0-d5c9-45fb-8dd4-e7700c8caca6/

Haven't used VS in a long time. But the project properties panel used to show the command line generated for linking and compiling a project for a particular configuration. It used to be under the Advanced tab. Will using that directly from the command line serve your purpose? This method will not use the VS IDE at all.

Alternatively,

Steps:

  1. Create a project which has a dependency on all other projects.

  2. Write a script which builds this project with different configurations sequentially. You cannot create a single configuration which encapsulates all other configurations.

不是直接的,但是您可以让项目依赖于其他项目 - 因此您可以拥有一个“全部”或“安装”项目,并依赖其他所有项目。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM