简体   繁体   English

如何在命令行上构建Visual Studio 2008 C ++项目的所有配置?

[英]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. 我想在命令行上构建VS 2008 C ++项目的所有配置。 Something like: 就像是:

devenv TheProject.vcproj /build /nologo devenv TheProject.vcproj / build / nologo

But this doesn't work because the /build command insists on having a configuration following it like this: 但是这不起作用,因为/ build命令坚持像这样跟随它的配置:

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

Is there a way to get a command line build of all configurations within the vcproj file? 有没有办法在vcproj文件中获得所有配置的命令行构建?

I was thinking you can do what you want with MSBUILD, but it appears that it isn't much better for this than DEVENV. 我以为你可以用MSBUILD做你想做的事,但看起来它比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. 您仍然必须在命令行上指定每个配置,尽管使用MSBUILD或DEVENV编写批处理文件来完成此操作会很容易。

It looks like previous versions of the development environment may have supported an "ALL" option, but VS 2008 does not. 看起来先前版本的开发环境可能支持“ALL”选项,但VS 2008则不支持。

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

Haven't used VS in a long time. 很久没有使用过VS. 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. 它曾经位于“ Advanced选项卡下。 Will using that directly from the command line serve your purpose? 是否直接从命令行使用它可以达到您的目的? This method will not use the VS IDE at all. 此方法根本不会使用VS IDE。

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. 您无法创建封装所有其他配置的单个配置。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Visual C ++ 2008中显示命令行生成选项? - How do I show command-line build options in Visual C++ 2008? 使用命令行生成Visual Studio C ++项目 - Build a Visual Studio C++ project using the Command Line 如何在Visual Studio 2008(C ++项目)中重建项目后运行构建规则的项目 - How do I just run a projects post build rules with out rebuilding in Visual Studio 2008 (C++ project) 如何将C ++ Visual Studio 2008项目降级到2005年 - How Do I Downgrade a C++ Visual Studio 2008 Project to 2005 如何在 Visual Studio C++ 项目中删除单个文件的命令行选项? - How can I remove command line option for single file in the visual studio c++ project? 如何使用Visual Studio 2008打开vcxproj(Visual C ++项目) - How to open vcxproj (visual c++ project) with visual studio 2008 Visual Studio 2015社区命令行生成C ++项目不起作用 - Visual Studio 2015 Community command line build C++ project does not work 如何在 Visual Studio 中打开 C++ 项目文件夹? - How do I open a c++ project folder in visual studio? 如何创建Visual Studio 2008 C ++项目模板? - How to create a Visual Studio 2008 C++ project template? 如何将扩展链接到Project(Visual Studio C ++) - How do I link Extensions to Project (Visual Studio C++ )
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM