359
359
-- get ninja
360
360
function _get_ninja (package )
361
361
local ninja = find_tool (" ninja" )
362
+ print (" ninja" , ninja )
363
+ os .exec (" ninja --version" )
362
364
if ninja then
363
365
return ninja .program
364
366
end
@@ -601,9 +603,6 @@ function _get_configs_for_mingw(package, configs, opt)
601
603
if is_subhost (" windows" ) and opt .cmake_generator ~= " Ninja" then
602
604
envs .CMAKE_MAKE_PROGRAM = _get_mingw32_make (package )
603
605
end
604
- if opt .cmake_generator == " Ninja" then
605
- envs .CMAKE_MAKE_PROGRAM = " ninja"
606
- end
607
606
_fix_cxx_compiler_cmake (package , envs )
608
607
_insert_configs_from_envs (configs , envs , opt )
609
608
end
@@ -618,12 +617,7 @@ function _get_configs_for_wasm(package, configs, opt)
618
617
assert (emscripten_cmakefile , " Emscripten.cmake not found!" )
619
618
table.insert (configs , " -DCMAKE_TOOLCHAIN_FILE=" .. emscripten_cmakefile )
620
619
if is_subhost (" windows" ) then
621
- if opt .cmake_generator == " Ninja" then
622
- local ninja = _get_ninja (package )
623
- if ninja then
624
- table.insert (configs , " -DCMAKE_MAKE_PROGRAM=" .. ninja )
625
- end
626
- else
620
+ if opt .cmake_generator ~= " Ninja" then
627
621
local mingw_make = _get_mingw32_make (package )
628
622
if mingw_make then
629
623
table.insert (configs , " -DCMAKE_MAKE_PROGRAM=" .. mingw_make )
@@ -783,6 +777,11 @@ function _get_configs_for_generator(package, configs, opt)
783
777
table.insert (configs , " -DCMAKE_JOB_POOL_LINK:STRING=link" )
784
778
table.insert (configs , (" -DCMAKE_JOB_POOLS:STRING=compile=%s;link=%s" ):format (jobs , linkjobs ))
785
779
end
780
+ local ninja = _get_ninja (package )
781
+ print (" _get_configs_for_generator" , cmake_generator , ninja )
782
+ if ninja then
783
+ table.insert (configs , " -DCMAKE_MAKE_PROGRAM=" .. ninja )
784
+ end
786
785
end
787
786
elseif package :is_plat (" mingw" ) and is_subhost (" msys" ) then
788
787
table.insert (configs , " -G" )
@@ -964,6 +963,7 @@ function _get_configs(package, configs, opt)
964
963
table.insert (configs , " -DCMAKE_CXX_COMPILER_LAUNCHER=" .. ccache )
965
964
end
966
965
966
+ print (" configs" , configs )
967
967
return configs
968
968
end
969
969
@@ -1312,13 +1312,16 @@ function configure(package, configs, opt)
1312
1312
table.insert (argv , " -D" .. name .. " =" .. value )
1313
1313
end
1314
1314
end
1315
+ print (" before shrink" , argv )
1315
1316
-- shrink cmake arguments, fix too long arguments
1316
1317
-- @see https://github.com/xmake-io/xmake-repo/pull/5247#discussion_r1780302212
1317
1318
_shrink_cmake_arguments (argv , oldir , opt )
1318
1319
table.insert (argv , oldir )
1319
1320
1320
1321
-- do configure
1321
1322
local cmake = assert (find_tool (" cmake" ), " cmake not found!" )
1323
+ print (argv )
1324
+ print (package :name (), package :plat (), package :arch (), opt )
1322
1325
os .vrunv (cmake .program , argv , {envs = opt .envs or buildenvs (package , opt )})
1323
1326
os .cd (oldir )
1324
1327
end
0 commit comments