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

发布于 2024-09-09 07:21:49 字数 298 浏览 12 评论 0原文

我想在命令行上构建 VS 2008 C++ 项目的所有配置。像这样的东西:

devenv TheProject.vcproj /build /nologo

但这不起作用,因为 /build 命令坚持要求其后面有一个配置,如下所示:

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

有没有办法获得 vcproj 文件中所有配置的命令行构建?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

¢好甜 2024-09-16 07:21:49

我以为你可以用 MSBUILD 做你想做的事,但看起来它并不比 DEVENV 好多少。

您仍然必须在命令行上指定每个配置,尽管使用 MSBUILD 或 DEVENV 编写批处理文件来完成此操作很容易。

看起来以前版本的开发环境可能支持“ALL”选项,但 VS 2008 不支持。

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

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/

怂人 2024-09-16 07:21:49

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

Not directly, but you can have projects depend on other projects - so you could have an 'all' or 'install' project with a dependacy of everything else.

一页 2024-09-16 07:21:49

好久没用VS了。但项目属性面板用于显示为链接和编译特定配置的项目而生成的命令行。它曾经位于高级选项卡下。直接从命令行使用它可以达到您的目的吗?这种方法根本不会使用VS IDE。

或者,

步骤:

  1. 创建一个依赖于所有其他项目的项目。

  2. 编写一个脚本,依次使用不同的配置构建此项目。您无法创建封装所有其他配置的单个配置。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文