summaryrefslogtreecommitdiff
path: root/xmake/toolchains/mingw/check.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-07-27 22:39:10 +0800
committerruki <[email protected]>2023-07-27 22:39:10 +0800
commitd23c643fe0bb9f2c6a05d8438cc2fa88c56929c2 (patch)
tree7e34d2a1d97e50cda96115954a8784c9e9cd3bbb /xmake/toolchains/mingw/check.lua
parent1bf614da70028c2f1316d0ec6e22cd39dd8540aa (diff)
improve mingw
Diffstat (limited to 'xmake/toolchains/mingw/check.lua')
-rw-r--r--xmake/toolchains/mingw/check.lua27
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