diff options
| author | ruki <[email protected]> | 2021-02-03 00:39:01 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-03 00:39:01 +0800 |
| commit | a76aab983d3acb30cf8138bffbc4f755c649fb30 (patch) | |
| tree | 4efaec3d4f72ccc37791f3ebd2d1fc8a94898801 /xmake/toolchains/cross/check.lua | |
| parent | 8caf1c9c6a3481e933a74bd5977eb3448c56c4c8 (diff) | |
improve extractor
Diffstat (limited to 'xmake/toolchains/cross/check.lua')
| -rw-r--r-- | xmake/toolchains/cross/check.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/toolchains/cross/check.lua b/xmake/toolchains/cross/check.lua index 695c746d2..c4c22bd83 100644 --- a/xmake/toolchains/cross/check.lua +++ b/xmake/toolchains/cross/check.lua @@ -33,8 +33,20 @@ function main(toolchain) return end - -- find cross toolchain + -- find cross toolchain from external envirnoment local cross_toolchain = find_cross_toolchain(sdkdir, {bindir = bindir, cross = cross}) + 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, {cross = cross}) + 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}) |
