summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-01-23 23:09:59 +0800
committerruki <[email protected]>2024-01-25 12:09:58 +0800
commit4e8b4b2c8bd84fb28aefcbf6ceb9eff5cd06143c (patch)
tree4071523287fed23148e20bd198bd4d8f98600214 /xmake/core/project/target.lua
parent5b7ead17c49b68f8cfd6ca5325f5ccfe1b3e82cc (diff)
fix package runtimes
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index b5fe3b35b..6e0b4d06d 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -2387,10 +2387,13 @@ function _instance:runtimes()
runtimes = self:get("runtimes")
if runtimes then
local runtimes_supported = hashset.new()
- for _, toolchain_inst in ipairs(self:toolchains()) do
- if toolchain_inst:is_standalone() and toolchain_inst:get("runtimes") then
- for _, runtime in ipairs(table.wrap(toolchain_inst:get("runtimes"))) do
- runtimes_supported:insert(runtime)
+ local toolchains = self:toolchains() or platform.load(self:plat(), self:arch()):toolchains()
+ if toolchains then
+ for _, toolchain_inst in ipairs(toolchains) do
+ if toolchain_inst:is_standalone() and toolchain_inst:get("runtimes") then
+ for _, runtime in ipairs(table.wrap(toolchain_inst:get("runtimes"))) do
+ runtimes_supported:insert(runtime)
+ end
end
end
end