diff options
| author | ruki <[email protected]> | 2021-02-02 00:28:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-02 08:56:47 +0800 |
| commit | e0b610d9bd2e87828ac4fc5435aca1ff191fbb85 (patch) | |
| tree | 9241626d3b8c8a5be8c6fdc00186349eadc10d1d /xmake/toolchains | |
| parent | 3fd3d534399ba5610434f947859587b4636591b1 (diff) | |
improve llvm toolchain
Diffstat (limited to 'xmake/toolchains')
| -rw-r--r-- | xmake/toolchains/llvm/check.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/toolchains/llvm/check.lua b/xmake/toolchains/llvm/check.lua index eaebf8eaa..f22d65f5e 100644 --- a/xmake/toolchains/llvm/check.lua +++ b/xmake/toolchains/llvm/check.lua @@ -62,8 +62,20 @@ function main(toolchain) end end - -- find cross toolchain + -- find cross toolchain from external envirnoment local cross_toolchain = find_cross_toolchain(sdkdir, {bindir = bindir}) + if not cross_toolchain then + -- find it from packages + for _, package in ipairs(toolchain:packages()) do + local installdir = package:installdir() + if installdir and os.isdir(installdir) then + cross_toolchain = find_cross_toolchain(installdir) + if cross_toolchain then + break + end + end + end + end if cross_toolchain then config.set("cross", cross_toolchain.cross, {readonly = true, force = true}) config.set("bin", cross_toolchain.bindir, {readonly = true, force = true}) |
