diff --git a/xmake/modules/detect/sdks/find_mingw.lua b/xmake/modules/detect/sdks/find_mingw.lua index 7be315a9ca1..e5276834b98 100644 --- a/xmake/modules/detect/sdks/find_mingw.lua +++ b/xmake/modules/detect/sdks/find_mingw.lua @@ -94,6 +94,9 @@ function _find_mingw(sdkdir, bindir, cross) -- find cross toolchain local toolchain = find_cross_toolchain(sdkdir or bindir, {bindir = bindir, cross = cross}) + if not toolchain then -- fallback, e.g. gcc.exe without cross + toolchain = find_cross_toolchain(sdkdir or bindir, {bindir = bindir}) + end if toolchain then return {sdkdir = toolchain.sdkdir, bindir = toolchain.bindir, cross = toolchain.cross} end