summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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