|
357 | 357 |
|
358 | 358 | -- get mingw32 make
|
359 | 359 | function _get_mingw32_make(package)
|
360 |
| - local mingw = assert(package:build_getenv("mingw") or package:build_getenv("sdk"), "mingw not found!") |
361 |
| - return _translate_bin_path(path.join(mingw, "bin", "mingw32-make.exe")) |
| 360 | + local mingw = package:build_getenv("mingw") or package:build_getenv("sdk") |
| 361 | + if mingw then |
| 362 | + local mingw_make = _translate_bin_path(path.join(mingw, "bin", "mingw32-make.exe")) |
| 363 | + if os.isfile(mingw_make) then |
| 364 | + return mingw_make |
| 365 | + end |
| 366 | + end |
362 | 367 | end
|
363 | 368 |
|
364 | 369 | -- https://github.com/xmake-io/xmake-repo/pull/1096
|
@@ -597,7 +602,10 @@ function _get_configs_for_wasm(package, configs, opt)
|
597 | 602 | assert(emscripten_cmakefile, "Emscripten.cmake not found!")
|
598 | 603 | table.insert(configs, "-DCMAKE_TOOLCHAIN_FILE=" .. emscripten_cmakefile)
|
599 | 604 | if is_subhost("windows") and opt.cmake_generator ~= "Ninja" then
|
600 |
| - table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. _get_mingw32_make(package)) |
| 605 | + local mingw_make = _get_mingw32_make(package) |
| 606 | + if mingw_make then |
| 607 | + table.insert(configs, "-DCMAKE_MAKE_PROGRAM=" .. mingw_make) |
| 608 | + end |
601 | 609 | end
|
602 | 610 | _get_configs_for_generic(package, configs, opt)
|
603 | 611 | end
|
@@ -1004,7 +1012,7 @@ function _build_for_make(package, configs, opt)
|
1004 | 1012 | if is_host("bsd") then
|
1005 | 1013 | os.vrunv("gmake", argv)
|
1006 | 1014 | elseif is_subhost("windows") and package:is_plat("mingw") then
|
1007 |
| - local mingw_make = _get_mingw32_make(package) |
| 1015 | + local mingw_make = assert(_get_mingw32_make(package), "mingw32-make.exe not found!") |
1008 | 1016 | os.vrunv(mingw_make, argv)
|
1009 | 1017 | elseif package:is_plat("android") and is_host("windows") then
|
1010 | 1018 | local make
|
@@ -1079,7 +1087,7 @@ function _install_for_make(package, configs, opt)
|
1079 | 1087 | os.vrunv("gmake", argv)
|
1080 | 1088 | os.vrunv("gmake", {"install"})
|
1081 | 1089 | elseif is_subhost("windows") and package:is_plat("mingw", "wasm") then
|
1082 |
| - local mingw_make = _get_mingw32_make(package) |
| 1090 | + local mingw_make = assert(_get_mingw32_make(package), "mingw32-make.exe not found!") |
1083 | 1091 | os.vrunv(mingw_make, argv)
|
1084 | 1092 | os.vrunv(mingw_make, {"install"})
|
1085 | 1093 | elseif package:is_plat("android") and is_host("windows") then
|
@@ -1134,7 +1142,7 @@ function _get_cmake_generator(package, opt)
|
1134 | 1142 | cmake_generator = "Ninja"
|
1135 | 1143 | elseif is_subhost("windows") and package:is_plat("mingw") then
|
1136 | 1144 | local mingw_make = _get_mingw32_make(package)
|
1137 |
| - if not os.isfile(mingw_make) and find_tool("ninja") then |
| 1145 | + if not mingw_make and find_tool("ninja") then |
1138 | 1146 | cmake_generator = "Ninja"
|
1139 | 1147 | end
|
1140 | 1148 | end
|
|
0 commit comments