summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-10-17 00:41:04 +0800
committerruki <[email protected]>2024-10-17 00:41:04 +0800
commit5da59ed0a5da2b1f992c8548ca0325714c1ea4b3 (patch)
treea93338655a967eb9d0d513aea4731077a261efbd /xmake/modules/package/tools/cmake.lua
parentcd6663abb6da35cb798004f19b1d106f3cc73f50 (diff)
fix ninja for cmake
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 2528ec25b..7c3c52fd2 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -1158,7 +1158,11 @@ 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") or package:policy("package.cmake_generator.ninja") then
+ local use_ninja = package:policy("package.cmake_generator.ninja")
+ if use_ninja == nil then
+ use_ninja = project.policy("package.cmake_generator.ninja")
+ end
+ if use_ninja then
cmake_generator = "Ninja"
end
if not cmake_generator then