最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

MSBuild build order of C++ ProjectReferences for staticdynamic libraries? - Stack Overflow

programmeradmin1浏览0评论

Does MSBuild consider whether a .vcxproj project is compiling to a static vs. dynamic lib when deducing build order?

For example, lets say I have four projects, which produce either a static or dynamic binary:

A.vcxproj -> A.lib
B.vcxproj -> B.dll
C.vcxproj -> C.lib
D.vcxproj -> D.dll

And that these projects have ProjectReferences defined like so:

<!-- For B.vcxproj -->
<PropertyGroup>
  <ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<ItemGroup>
  <ProjectReference Include="A.vcxproj"/>
</ItemGroup>

...such that it creates a dependency chain like this (where X -> Y means "X is a dependency of Y"):

A -> B -> C -> D

In other words...

A.lib -> B.dll -> C.lib -> D.dll

Static libraries aren't needed until they're linked into a dynamic library or executable. Knowing that, the most efficient build graph assuming you can have multiple builds running is:

A.lib -> B.dll -> D.dll
         C.lib ---^

Will MSBuild recognize that this build ordering is possible if it's allowed to run multiple builds at once? Or will it simply build exactly how the project references are laid out?

发布评论

评论列表(0)

  1. 暂无评论