summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-02-26 23:55:23 +0800
committerruki <[email protected]>2024-02-26 23:55:23 +0800
commit3b8f2a5de39f026e17694eaad625ea8190501665 (patch)
treeee5b825ea47922b24c67fdf63be3886ce5076df4
parent76af94c04ba55dfe7a5087ce76dfeba4a709ba46 (diff)
fix toolchain formats #4769
-rw-r--r--xmake/core/project/target.lua2
-rw-r--r--xmake/core/tool/toolchain.lua6
2 files changed, 7 insertions, 1 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 208054ff3..7d2c7d82f 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -549,7 +549,7 @@ function _instance:_format(kind)
local formats = self._FORMATS
if not formats then
for _, toolchain_inst in ipairs(self:toolchains()) do
- formats = toolchain_inst:get("formats")
+ formats = toolchain_inst:formats()
if formats then
break
end
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua
index 620b862d5..057153ca7 100644
--- a/xmake/core/tool/toolchain.lua
+++ b/xmake/core/tool/toolchain.lua
@@ -156,6 +156,12 @@ function _instance:kind()
return self:info():get("kind")
end
+-- get toolchain formats, we must set it in description scope
+-- @see https://github.com/xmake-io/xmake/issues/4769
+function _instance:formats()
+ return self:info():get("formats")
+end
+
-- is cross-compilation toolchain?
function _instance:is_cross()
if self:kind() == "cross" then