summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-10-01 00:41:18 +0800
committerruki <[email protected]>2021-10-01 00:41:18 +0800
commited6dd5f22cc4f8b8a85e3146082e5bd48797292a (patch)
tree03d5744ef7f2d3d118c94103d0570ef7f017b329
parent5c940914eb8c2b1e7a4ebffe34994405d3dd68ed (diff)
improve tools/xmake
-rw-r--r--xmake/modules/package/tools/xmake.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua
index facbf2be6..e782eb834 100644
--- a/xmake/modules/package/tools/xmake.lua
+++ b/xmake/modules/package/tools/xmake.lua
@@ -66,10 +66,6 @@ function _get_configs(package, configs)
if sdkdir then
table.insert(configs, "--sdk=" .. sdkdir)
end
- local toolchain_name = get_config("toolchain")
- if toolchain_name then
- table.insert(configs, "--toolchain=" .. toolchain_name)
- end
else
local names = {"ndk", "ndk_sdkver", "vs", "mingw", "ld", "sh", "ar", "cc", "cxx", "mm", "mxx"}
for _, name in ipairs(names) do
@@ -79,6 +75,13 @@ function _get_configs(package, configs)
end
end
end
+ -- we can only modify toolchain for linux or cross-compilation
+ if package:is_plat("linux", "cross") then
+ local toolchain_name = get_config("toolchain")
+ if toolchain_name then
+ table.insert(configs, "--toolchain=" .. toolchain_name)
+ end
+ end
if not package:is_plat("windows", "mingw") and package:config("pic") ~= false then
table.insert(cxflags, "-fPIC")
end