summaryrefslogtreecommitdiff
path: root/xmake/platforms/linux/checker.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-06-10 13:26:47 +0800
committerruki <[email protected]>2016-06-10 13:26:47 +0800
commit38c07cd824a33740accf14dda963aad1f2dc9366 (patch)
treef4883f4af6965bbb7ddf27b8d2bfc9b946bf93d9 /xmake/platforms/linux/checker.lua
parentcb9ce25dd0e7669189124a89bf6171190707b13e (diff)
improve mingw and cross toolchains configure
Diffstat (limited to 'xmake/platforms/linux/checker.lua')
-rw-r--r--xmake/platforms/linux/checker.lua33
1 files changed, 27 insertions, 6 deletions
diff --git a/xmake/platforms/linux/checker.lua b/xmake/platforms/linux/checker.lua
index fc2b32137..499a5ef1d 100644
--- a/xmake/platforms/linux/checker.lua
+++ b/xmake/platforms/linux/checker.lua
@@ -42,13 +42,34 @@ end
-- check the toolchains
function _check_toolchains(config)
+ -- get toolchains
+ local toolchains = config.get("toolchains")
+ if not toolchains then
+ local sdkdir = config.get("sdk")
+ if sdkdir then
+ toolchains = path.join(sdkdir, "bin")
+ end
+ end
+
+ -- get cross
+ local cross = ""
+ if toolchains then
+ local arpathes = os.match(path.join(toolchains, "*-ar"))
+ for _, arpath in ipairs(arpathes) do
+ local arname = path.basename(arpath)
+ if arname then
+ cross = arname:sub(1, -3)
+ end
+ end
+ end
+
-- done
- checker.check_toolchain(config, "cc", "", "gcc", "the c compiler")
- checker.check_toolchain(config, "cxx", "", "g++", "the c++ compiler")
- checker.check_toolchain(config, "as", "", "gcc", "the assember")
- checker.check_toolchain(config, "ld", "", "g++", "the linker")
- checker.check_toolchain(config, "ar", "", "ar", "the static library linker")
- checker.check_toolchain(config, "sh", "", "g++", "the shared library linker")
+ checker.check_toolchain(config, "cc", cross, "gcc", "the c compiler")
+ checker.check_toolchain(config, "cxx", cross, "g++", "the c++ compiler")
+ checker.check_toolchain(config, "as", cross, "gcc", "the assember")
+ checker.check_toolchain(config, "ld", cross, "g++", "the linker")
+ checker.check_toolchain(config, "ar", cross, "ar", "the static library linker")
+ checker.check_toolchain(config, "sh", cross, "g++", "the shared library linker")
end
-- init it