From 56f568d355131c3408fee3edfbf55b4c1ecc39b8 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 27 Mar 2021 23:24:34 +0800 Subject: improve to find cross toolchain --- xmake/modules/detect/sdks/find_cross_toolchain.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xmake/modules/detect/sdks/find_cross_toolchain.lua b/xmake/modules/detect/sdks/find_cross_toolchain.lua index 800e12a26..04c66e626 100644 --- a/xmake/modules/detect/sdks/find_cross_toolchain.lua +++ b/xmake/modules/detect/sdks/find_cross_toolchain.lua @@ -43,15 +43,17 @@ function _find_bindir(sdkdir, opt) end -- find tool path - toolpath = find_file(toolname, bindirs) - if toolpath then - return path.directory(toolpath), "" + if not opt.cross then + toolpath = find_file(toolname, bindirs) + if toolpath then + return path.directory(toolpath), "" + end end end -- attempt to use the bin directory local bindir = opt.bindir or path.join(sdkdir, "bin") - if os.isdir(bindir) then + if os.isdir(bindir) and not opt.cross then return bindir end end -- cgit v1.3.1