path: root/Directory.Build.props
diff options
authorJacek Blaszczynski <>2017-11-04 19:11:25 +0100
committerWes Haggard <>2017-11-04 11:11:25 -0700
commit5a01d8a39576f0d07441e4d123a90138f4ae0735 (patch)
treef1f4f9e4f368181d8ba3d86ff563100157f8eb73 /Directory.Build.props
parent9345244f8172de638223cd7c1e48a5cd169185eb (diff)
[Infrastructure] Use MSBuild v15 extension point to control CL parallelism, abstract MSBuild /maxcpucount switch (#14578)
This commit frees -ExtraParameters and uses MSBuild v15 extension point to control CL compiler parallelism. If MSBuild 15.0 is available - installed with Visual Studio 2017 - CL parallelism control is achieved by using extension point in Microsoft.Common.props file which allows to include Directory.Build.props - for details see [Microsoft.Common.props] [1] file in MSBuild repo. MSBuild parallelism is controled via abstracted /maxcpucount command line switch which now is available as -MSBuildNodeCount pass through run.cmd/ command line argument with default value equal to /maxcpucount (what defaults to number of logical processors). This allows to control MSBuild parallelism on all supported platforms. It is possible to control MSBuild parallelism programatically via MSBuild public API using MaxNodeCount properties available on the following APIs: Microsoft.Build.Evaluation.ProjectCollection.MaxNodeCount Microsoft.Build.Execution.BuildParameters.MaxNodeCount It's use in current build infrastructure would require creating unnecessary complexity and was ruled out.
Diffstat (limited to 'Directory.Build.props')
1 files changed, 5 insertions, 0 deletions
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000000..3efd9a363c
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,5 @@
+<Project DefaultTargets="Build" xmlns="">
+ <PropertyGroup>
+ <CL_MPCount>$(NumberOfCores)</CL_MPCount>
+ </PropertyGroup>