summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/msbuild.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-22 17:41:30 +0800
committerGitHub <[email protected]>2024-07-22 17:41:30 +0800
commitaf5c479c7fc1eecf540b3e930b250a79ca34f19c (patch)
tree1e8136c11c5d9ff18618ee703d01f50a9e68d5da /xmake/modules/package/tools/msbuild.lua
parentc88a078c25a89452853e068ed06e0de6edefb4eb (diff)
parentbcdc71d60d1896c71a057438a859d9e6f7126c80 (diff)
Merge pull request #5367 from ChrisCatCP/msbuild
add policy msbuild.multi_tool_task
Diffstat (limited to 'xmake/modules/package/tools/msbuild.lua')
-rw-r--r--xmake/modules/package/tools/msbuild.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/msbuild.lua b/xmake/modules/package/tools/msbuild.lua
index 34aa86453..e6945168e 100644
--- a/xmake/modules/package/tools/msbuild.lua
+++ b/xmake/modules/package/tools/msbuild.lua
@@ -20,6 +20,7 @@
-- imports
import("core.base.option")
+import("core.project.project")
import("core.tool.toolchain")
import("lib.detect.find_tool")
import("private.utils.upgrade_vsproj")
@@ -64,6 +65,11 @@ function _get_configs(package, configs, opt)
if not configs_str:find("p:Platform=", 1, true) then
table.insert(configs, "-p:Platform=" .. _get_vsarch(package))
end
+ if jobs and project.policy("package.msbuild.multi_tool_task") then
+ table.insert(configs, "/p:UseMultiToolTask=true")
+ table.insert(configs, "/p:EnforceProcessCountAcrossBuilds=true")
+ table.insert(configs, format("/p:MultiProcMaxCount=%d", jobs))
+ end
return configs
end