fix ninja for cmake

This commit is contained in:
ruki 2024-10-17 00:41:04 +08:00
parent cd6663abb6
commit 5da59ed0a5
1 changed files with 5 additions and 1 deletions

View File

@ -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