diff options
| -rw-r--r-- | xmake/toolchains/mingw/check.lua | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/xmake/toolchains/mingw/check.lua b/xmake/toolchains/mingw/check.lua index 22a13fadd..483b98ffb 100644 --- a/xmake/toolchains/mingw/check.lua +++ b/xmake/toolchains/mingw/check.lua @@ -24,29 +24,24 @@ import("detect.sdks.find_mingw") -- check the mingw toolchain function main(toolchain) - local mingw = find_mingw(toolchain:config("mingw") or config.get("mingw"), {verbose = true, bindir = toolchain:bindir(), cross = toolchain:cross()}) - if not mingw then - for _, package in ipairs(toolchain:packages()) do - local installdir = package:installdir() - if installdir and os.isdir(installdir) then - mingw = find_mingw(installdir, {verbose = true, cross = toolchain:cross()}) - if mingw then - break - end + local mingw + for _, package in ipairs(toolchain:packages()) do + local installdir = package:installdir() + if installdir and os.isdir(installdir) then + mingw = find_mingw(installdir, {verbose = true, cross = toolchain:cross()}) + if mingw then + break end end end + if not mingw then + mingw = find_mingw(toolchain:config("mingw") or config.get("mingw"), {verbose = true, bindir = toolchain:bindir(), cross = toolchain:cross()}) + end if mingw then toolchain:config_set("mingw", mingw.sdkdir) toolchain:config_set("cross", mingw.cross) toolchain:config_set("bindir", mingw.bindir) toolchain:configs_save() - else - -- failed - cprint("${bright color.error}please run:") - cprint(" - xmake config --mingw=xxx") - cprint("or - xmake global --mingw=xxx") - raise() + return true end - return true end |
