VS2005 - 具有相同源构建顺序的两个项目 [英] VS2005 - Two Projects with Same Source Build Order
问题描述
我们正在开发VS2005,并且我们需要构建一个组件作为.dll和静态库。我在源目录中创建了两个项目文件,唯一的区别是一个构建为dll,另一个构建为静态库。唯一的方法
我可以让两个项目在构建期间很好地发挥(不同时争夺相同的文件)是创建一个项目依赖项,以确保在项目1构建完成之前不构建项目2 。
We are developing in VS2005 and have a component we need to build as both a .dll and a static library. I created two project files in the source directory with the only differences being one builds as a dll and the other as a static library. The only way I could get the two projects to play nicely during building (not fighting over the same files at the same time) was to create a project dependency to make sure project 2 does not build until project 1 build is completed.
虽然这会带来良好的构建,但我想知道在使用这种方法时是否有任何运行时影响?
While this results in a good build, I'm would like to know if there are any run-time implications I am not considering when using this method?
谢谢。
推荐答案
我认为没有影响,因为项目是独立的,只有构建具有依赖性。
I don't think there are implications, because the projects are independent, only the build has a dependency.
如果您想尝试,还有其他方法:
There are other approaches if you want to try:
- 您可以将Visual Studio配置为在一个项目中构建一个项目时间。但是,这会影响所有解决方案:
- You can configure Visual Studio to build one project at a time. This affects all solutions, though:
选项窗口,项目和解决方案>构建和运行,并行项目构建的最大数量
Options window, Projects and Solutions > Build and run, Maximum number of parallel project builds
- 您可以拥有这两个项目的解决方案并定义两个解决方案配置。在其中一个中你排除了一个项目,另一个你排除了另一个项目。
- You can have a solution with the two projects and define two solution configurations. In one of them you exclude a project, and in the other you exclude the other project.
- 你可以拥有一个项目的解决方案,并在Visual Studio之外构建它两次,使用一个例如,脚本。您可以在项目文件中定义一个MSBuild属性(例如:"BuildType"),其值(dll或静态)作为属性
传递给项目:
- You can have a solution with a single project and build it twice outside Visual Studio, using a script, for example. You would define a MSBuild property inside the project file (example: "BuildType") whose value (dll or static) you pass as property to the project:
msbuild.exe <projectfile> /p:BuildType=...
这篇关于VS2005 - 具有相同源构建顺序的两个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!