如何控制批生成订单→生成所有 [英] How to control order of Batch Build → Build All

查看:209
本文介绍了如何控制批生成订单→生成所有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有4个项目和24配置的C ++解决方案。该项目是 cryptest cryptlib cryptdll dlltest 。再有就是86,64,调试,释放DLL导出和DLL导入的部分横产物。

I have a C++ solution with 4 projects and 24 configurations. The projects are cryptest, cryptlib, cryptdll and dlltest. And then there's a partial cross product of x86, x64, debug, release, DLL export, and DLL import.

有一个不那么明显的相关性,我似乎无法在用户界面或通过手动修改项目文件前preSS。依赖关系为所有 DLL的相关项目取决于 cryptest,发布的Win32

There's a not-so-apparent dependency that I can't seem to express under the UI or by modifying the project files by hand. The dependency is all the DLL related projects depend upon cryptest, Release Win32.

Visual Studio中允许我们选择建立所有的配置在构建菜单,然后 批生成...→全选→生成 。当我执行 全部构建,建立了第一个配置是:

Visual Studio allows us to build all configurations by selecting the Build menu, and then Batch Build... → Select All → Build. When I perform a Build All, the first configuration built is:

------ Build started: Project: cryptlib, Configuration: DLL-Import Debug x64 ------
Performing Custom Build Step
 Assembling: c:\Documents and Settings\cryptopp-5.6.3\x64masm.asm
Performing Custom Build Step
Compiling...
pch.cpp
...

以上可以看出,机械选 cryptlib,DLL的导入调试64 为首选。我想下面的命令:

As can be seen above, the machinery chooses cryptlib, DLL-Import Debug x64 as its first choice. I want the following order:


  • cryptlib,发布的Win32

  • cryptest,发布的Win32

  • 请不要在意其余22 ....

问题是我不能告诉Visual Studio中的所有 Win32和x64的DLL项目取决于在Win32的 cryptest

The problem is I cannot tell Visual studio that all Win32 and x64 DLL projects depend upon the Win32 cryptest.

我如何控制顺序 批量生成→生成所有

How can I control the order of Batch Build → Build All?

目前我已经运行通过的全部构建的两倍。与第一端部

Currently I have to run through Build All twice. The first ends with:

========== Build: 20 succeeded, 4 failed, 0 up-to-date, 0 skipped ==========

第二次运行结尾:

The second run ends with:

========== Build: 4 succeeded, 0 failed, 20 up-to-date, 0 skipped ==========


重新排序当溶液文件的 GlobalSection(ProjectConfigurationPlatforms)用文本编辑器(并将它们放在我想要的确切顺序),这些都是那种温暖和模糊的结果我遇到的问题。 24配置将建立与 全部构建在Visual Studio 2005中,但 全部构建不执行任何操作(从字面上看,没有什么)测试升级后的Visual Studio 2008下。


When reordering the solution file's GlobalSection(ProjectConfigurationPlatforms) with a text editor (and placing them in the exact order I want), these are the kind of warm and fuzzy results I encounter. The 24 configurations will build with Build All under Visual Studio 2005, but Build All does nothing (literally, nothing) under Visual Studio 2008 after testing an upgrade.

当我尝试手动生成一个项目(右键单击项目,然后点击构建),我得到这样的结果:

And when I manually try to build a project (right click project, then Build), I get a result like:

1>------ Skipped Build: Project: cryptlib ------
1> 
2>------ Skipped Build: Project: cryptest ------
2> 

在没有理由或解释。它如果 Visual Studio的企图破译的行为提供了一个日志文件肯定会很好。

一个相关的问题是Visual Studio中选择<<一些项目>> 作为默认的启动项目,没有声明方式去改变它。也就是说,一个特定的项目需要在溶液文件中列出的第一个,并且不能改变。

A related issue is Visual Studio selects << some project >> as the default Startup project with no declarative way to change it. That means a particular project needs to be the first one listed in the solution file, and that cannot change.

我有一个很难找到一个解决方案,友好双方的Visual Studio 2005(如何在源文件分布)和后Visual Studio 2010的升级(一些人如何使用它)。

I'm having a hard time finding a solution that is amicable to both Visual Studio 2005 (how the source files are distributed) and a post-Visual Studio 2010 upgrade (how some folks use it).

我有种找到关于这个问题的一些资料,像的项目设置从一个博客VS2010 变化。但它不是一个真正清楚如何,如上所述,与该博客只适用于VS2010或上述效果的依赖变化

I can kind of find some information on the subject, like Project settings changes with VS2010 from a blog. But its not really clear how to effect a dependency change as described above, and the blog only applies to VS2010 or above.

推荐答案

创建cryptest和cryptlib一个x86和x64的项目。

对于每个在x86 / x64项目对,可以使用的添加链接的链接到所有文件中的其他项目,所以你只需要每个文件的只有一个副本。

For each x86/x64 project pair, use Add As Link to link to all the files in the other project so you only have just one copy of each file.

...用红色箭头所示的链接...

...links shown with the red arrows...

配置管理器

使用配置管理器仅用于x64项目只建为x86项目的x86,和x64。

Use Configuration Manager to build x86 only for the x86 projects, and x64 only for the x64 projects.

也可以使用每个下拉的平台的并删除并不适用于相应的项目额外的平台。

Also use the dropdown for each Platform and remove the extra platform that does not apply to the corresponding project.

另外,还要确保用于x86构建你是不是建设的x64的目标,并为64构建你是不是通过取消建造86目标的适当的构建的复选框。

Also ensure that for x86 builds you are not building x64 targets, and for x64 builds you are not building x86 targets by unchecking the appropriate Build checkbox.

依赖

创建依赖这样:


  • cryptlib32取决于什么

  • cryptest32取决于cryptlib32

  • cryptlib64取决于cryptlib32和cryptest32

  • cryptest64取决于cryptlib64

  • 所有其余项目取决于cryptlib32 / 64和cryptest32 / 64酌情

...一个例子...

...one example...

结果

这应该产生你想要的结果。

This should produce the results you want.

测试

在我的测试项目,这个工作如预期。我叫我所有的code与preFIX ClassLibraries ,和刚才添加 LIB 测试上月底模仿你的配置和最后只是前两个项目之后的任何项目...

In my test project, this worked as expected. I named all my code with the prefix ClassLibraries, and just added lib and test on the end to mimic your config, and final is just any project after the first two projects...

X86的lib和测试版本,第一,64 lib和测试下了,所有其他的东西如下...

The x86 lib and test build first, x64 lib and test next, and all the other stuff follows...

------ Rebuild All started: Project: ClassLibraryLib32, Configuration: Debug x86 ------
  ClassLibraryLib32 -> C:\Users\Kory\Source\KoryG-Code\Solution1\ClassLibraryLib32\bin\x86\Debug\ClassLibraryLib.dll
------ Rebuild All started: Project: ClassLibraryLib32, Configuration: Release x86 ------
  ClassLibraryLib32 -> C:\Users\Kory\Source\KoryG-Code\Solution1\ClassLibraryLib32\bin\x86\Release\ClassLibraryLib.dll
------ Rebuild All started: Project: ClassLibraryTest32, Configuration: Release x86 ------
  ClassLibraryTest32 -> c:\users\kory\Source\KoryG-Code\Solution1\ClassLibraryTest32\bin\x86\Release\ClassLibraryTest.dll
------ Rebuild All started: Project: ClassLibraryTest32, Configuration: Debug x86 ------
  ClassLibraryTest32 -> c:\users\kory\Source\KoryG-Code\Solution1\ClassLibraryTest32\bin\x86\Debug\ClassLibraryTest.dll
------ Rebuild All started: Project: ClassLibraryLib64, Configuration: Debug x64 ------
  ClassLibraryLib64 -> C:\Users\Kory\Source\KoryG-Code\Solution1\ClassLibraryLib64\bin\x64\Debug\ClassLibraryLib.dll
------ Rebuild All started: Project: ClassLibraryLib64, Configuration: Release x64 ------
  ClassLibraryLib64 -> C:\Users\Kory\Source\KoryG-Code\Solution1\ClassLibraryLib64\bin\x64\Release\ClassLibraryLib.dll
------ Rebuild All started: Project: ClassLibraryTest64, Configuration: Release x64 ------
  ClassLibraryTest64 -> c:\users\kory\Source\KoryG-Code\Solution1\ClassLibraryTest64\bin\x64\Release\ClassLibraryTest.dll
------ Rebuild All started: Project: ClassLibraryTest64, Configuration: Debug x64 ------
  ClassLibraryTest64 -> c:\users\kory\Source\KoryG-Code\Solution1\ClassLibraryTest64\bin\x64\Debug\ClassLibraryTest.dll
------ Rebuild All started: Project: ClassLibraryFinal, Configuration: Release x86 ------
  ClassLibraryFinal -> c:\users\kory\Source\KoryG-Code\Solution1\ClassLibraryFinal\bin\x86\Release\ClassLibraryFinal.dll
------ Rebuild All started: Project: ClassLibraryFinal, Configuration: Release x64 ------
  ClassLibraryFinal -> c:\users\kory\Source\KoryG-Code\Solution1\ClassLibraryFinal\bin\x64\Release\ClassLibraryFinal.dll
------ Rebuild All started: Project: ClassLibraryFinal, Configuration: Debug x86 ------
  ClassLibraryFinal -> c:\users\kory\Source\KoryG-Code\Solution1\ClassLibraryFinal\bin\x86\Debug\ClassLibraryFinal.dll
------ Rebuild All started: Project: ClassLibraryFinal, Configuration: Debug x64 ------
  ClassLibraryFinal -> c:\users\kory\Source\KoryG-Code\Solution1\ClassLibraryFinal\bin\x64\Debug\ClassLibraryFinal.dll
========== Rebuild All: 12 succeeded, 0 failed, 0 skipped ==========

这篇关于如何控制批生成订单→生成所有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆