diff options
| author | ruki <[email protected]> | 2016-06-10 13:26:47 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-06-10 13:26:47 +0800 |
| commit | 38c07cd824a33740accf14dda963aad1f2dc9366 (patch) | |
| tree | f4883f4af6965bbb7ddf27b8d2bfc9b946bf93d9 /xmake/platforms/linux/checker.lua | |
| parent | cb9ce25dd0e7669189124a89bf6171190707b13e (diff) | |
improve mingw and cross toolchains configure
Diffstat (limited to 'xmake/platforms/linux/checker.lua')
| -rw-r--r-- | xmake/platforms/linux/checker.lua | 33 |
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 |
