summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-12-19 23:38:08 +0800
committerruki <[email protected]>2018-12-19 15:48:50 +0800
commit9677a8c2cfbdaa4c6b3f5d7eabdf95648f7723db (patch)
tree07ab37d89b560af1c97f0873c7f5b09a99732486
parent1758e5f01e5684bf8da0187bb5b6ee7ac93fd4e6 (diff)
improve mingw
-rw-r--r--xmake/modules/detect/sdks/find_mingw.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/modules/detect/sdks/find_mingw.lua b/xmake/modules/detect/sdks/find_mingw.lua
index bca84c80f..ef5f04fc2 100644
--- a/xmake/modules/detect/sdks/find_mingw.lua
+++ b/xmake/modules/detect/sdks/find_mingw.lua
@@ -54,6 +54,16 @@ function _find_mingw(sdkdir, bindir, cross)
return {}
end
+ -- select cross on macos, e.g x86_64-w64-mingw32- or i686-w64-mingw32-
+ if is_host("macosx") and not cross then
+ local arch = config.get("arch")
+ if not arch or arch == "i386" then
+ cross = "i686-*-"
+ else
+ cross = "x86_64-*-"
+ end
+ end
+
-- find cross toolchain
local toolchain = find_cross_toolchain(sdkdir or bindir, {bindir = bindir, cross = cross})
if toolchain then