diff options
| author | ruki <[email protected]> | 2023-05-09 23:11:30 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-05-09 23:11:30 +0800 |
| commit | 5b258b7996411c674d255ee15194d0c78afee9de (patch) | |
| tree | 080ad540544c130e9e39c307d1ccabb846bb5876 | |
| parent | 2c62b19832779f193df17ee55c71b3e9dc922563 (diff) | |
fix tools.xmake
| -rw-r--r-- | xmake/modules/package/tools/xmake.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua index dc4502419..4ad87605b 100644 --- a/xmake/modules/package/tools/xmake.lua +++ b/xmake/modules/package/tools/xmake.lua @@ -96,7 +96,13 @@ function _get_configs(package, configs, opt) end end else - local names = {"sdk", "ndk", "ndk_sdkver", "vs", "vs_toolset", "mingw", "ld", "sh", "ar", "cc", "cxx", "mm", "mxx"} + local names = {"ndk", "ndk_sdkver", "vs", "vs_toolset", "mingw", "ld", "sh", "ar", "cc", "cxx", "mm", "mxx"} + -- We only set the sdk directory when doing cross-compilation, + -- otherwise the host dependency package may also use the cross-compilation toolchain in sdk incorrectly. + -- e.g. build host python -> host zlib -> xmake f --plat=linux --arch=x86_64 --sdk=/tmp/aarch64-linux-musl-cross -> incorrect cross compilation + if package:is_cross() then + table.insert(names, "sdk") + end for _, name in ipairs(names) do local value = get_config(name) if value ~= nil then |
