diff options
| -rw-r--r-- | xmake/core/package/package.lua | 11 | ||||
| -rw-r--r-- | xmake/core/project/target.lua | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index f6b3e2f4c..30b2654a9 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1137,10 +1137,13 @@ function _instance:runtimes() runtimes = self:config("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 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 |
