diff options
| author | ruki <[email protected]> | 2023-08-11 22:50:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-08-11 22:50:22 +0800 |
| commit | d77ae95506850e96a07b9a0b807d363df80856bb (patch) | |
| tree | 0138011aa22231907d603b7947afaaf814d1c653 /xmake/core/project | |
| parent | e9bb721deae72ae84f0f262b673496dbd60a08bd (diff) | |
improve toolchains
Diffstat (limited to 'xmake/core/project')
| -rw-r--r-- | xmake/core/project/target.lua | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 4d4bf94dc..e9a603476 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -2077,10 +2077,10 @@ function _instance:toolchains() if toolchains == nil then -- load target toolchains first - toolchains = {} local has_standalone = false local target_toolchains = self:get("toolchains") if target_toolchains then + toolchains = {} for _, name in ipairs(table.wrap(target_toolchains)) do local toolchain_opt = table.copy(self:extraconf("toolchains", name)) toolchain_opt.arch = self:arch() @@ -2098,20 +2098,20 @@ function _instance:toolchains() end table.insert(toolchains, toolchain_inst) end - end - -- we need merge target and platform toolchains, - -- because we maybe only set partial toolchains in target, e.g. nasm toolchain - for _, toolchain_inst in ipairs(self:platform():toolchains()) do - if toolchain_inst:is_standalone() then - -- we can only add one standalone toolchain - if not has_standalone then - table.insert(toolchains, toolchain_inst) + -- we always need a standalone toolchain + -- because we maybe only set partial toolchains in target, e.g. nasm toolchain + if not has_standalone then + for _, toolchain_inst in ipairs(self:platform():toolchains()) do + if toolchain_inst:is_standalone() then + table.insert(toolchains, toolchain_inst) + has_standalone = true + break + end end - has_standalone = true - else - table.insert(toolchains, toolchain_inst) end + else + toolchains = self:platform():toolchains() end self:_memcache():set("toolchains", toolchains) |
