summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-25 17:05:49 +0800
committerGitHub <[email protected]>2024-07-25 17:05:49 +0800
commit845f7abc7145369118cbda0148e7e02fab6475f5 (patch)
tree6d938de66f0311938db01a4f0ca1fe6263fb3ea7
parenta066a32e9c668967fb11486e77f92b11c1a22f5d (diff)
parentfb38aef96ba744788c5dffdee38a4f818ba9e945 (diff)
Merge pull request #5395 from ChrisCatCP/policy
update policy
-rw-r--r--xmake/core/project/policy.lua2
-rw-r--r--xmake/modules/package/tools/cmake.lua2
-rw-r--r--xmake/modules/package/tools/msbuild.lua2
3 files changed, 3 insertions, 3 deletions
diff --git a/xmake/core/project/policy.lua b/xmake/core/project/policy.lua
index 2a2195cdb..3e02d210d 100644
--- a/xmake/core/project/policy.lua
+++ b/xmake/core/project/policy.lua
@@ -138,7 +138,7 @@ function policy.policies()
-- It will force cmake package use ninja for build
["package.cmake_generator.ninja"] = {description = "Set cmake package use ninja for build", default = false, type = "boolean"},
-- Enable msbuild MultiToolTask
- ["package.msbuild.multi_tool_task"] = {description = "Enable msbuild MultiToolTask.", type = "boolean"},
+ ["package.msbuild.multi_tool_task"] = {description = "Enable msbuild MultiToolTask.", default = false, type = "boolean"},
-- Stop to test on the first failure
["test.stop_on_first_failure"] = {description = "Stop to test on the first failure", default = false, type = "boolean"},
-- Return zero as exit code on failure
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index b4337c4f7..77c0f6228 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -1077,7 +1077,7 @@ function _get_cmake_generator(package, opt)
opt = opt or {}
local cmake_generator = opt.cmake_generator
if not cmake_generator then
- if project.policy("package.cmake_generator.ninja") then
+ if project.policy("package.cmake_generator.ninja") or package:policy("package.cmake_generator.ninja") then
cmake_generator = "Ninja"
end
if not cmake_generator then
diff --git a/xmake/modules/package/tools/msbuild.lua b/xmake/modules/package/tools/msbuild.lua
index 3ab9e76a2..c46e76479 100644
--- a/xmake/modules/package/tools/msbuild.lua
+++ b/xmake/modules/package/tools/msbuild.lua
@@ -65,7 +65,7 @@ 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 project.policy("package.msbuild.multi_tool_task") then
+ if project.policy("package.msbuild.multi_tool_task") or package:policy("package.msbuild.multi_tool_task") then
table.insert(configs, "/p:UseMultiToolTask=true")
table.insert(configs, "/p:EnforceProcessCountAcrossBuilds=true")
if jobs then