summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-03-17 23:00:06 +0800
committerruki <[email protected]>2021-03-17 23:00:06 +0800
commita9ff0bbb4c6227c53e4dcf1a6a4d1f14aaab0160 (patch)
tree3c97e63c3d7083ca7356be1f44bff0a0f9dc48fe
parent24b2a53378c9722010b9fe2f6fba8471269407fb (diff)
fix tools/xmake
-rw-r--r--xmake/core/package/package.lua5
-rw-r--r--xmake/modules/package/tools/xmake.lua10
2 files changed, 6 insertions, 9 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 30949661b..dcca352a6 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -645,12 +645,9 @@ function _instance:build_envs(lazy_loading)
setmetatable(build_envs, { __index = function (tbl, key)
local value = config.get(key)
if value == nil then
- value = self:toolconfig(key)
- end
- if value == nil then
value = self:tool(key)
end
- value = table.unique(table.join(table.wrap(value), self:config(key)))
+ value = table.unique(table.join(table.wrap(value), table.wrap(self:config(key)), self:toolconfig(key)))
if #value > 0 then
value = table.unwrap(value)
rawset(tbl, key, value)
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua
index efe5e4f09..0c1cd2a14 100644
--- a/xmake/modules/package/tools/xmake.lua
+++ b/xmake/modules/package/tools/xmake.lua
@@ -74,19 +74,19 @@ function _get_configs(package, configs)
end
end
end
- if cflags then
+ if cflags and #cflags > 0 then
table.insert(configs, "--cflags=" .. table.concat(cflags, ' '))
end
- if cxflags then
+ if cxflags and #cxflags > 0 then
table.insert(configs, "--cxflags=" .. table.concat(cxflags, ' '))
end
- if cxxflags then
+ if cxxflags and #cxxflags > 0 then
table.insert(configs, "--cxxflags=" .. table.concat(cxxflags, ' '))
end
- if asflags then
+ if asflags and #asflags > 0 then
table.insert(configs, "--asflags=" .. table.concat(asflags, ' '))
end
- if ldflags then
+ if ldflags and #ldflags > 0 then
table.insert(configs, "--ldflags=" .. table.concat(ldflags, ' '))
end
return configs