diff options
| author | ruki <[email protected]> | 2020-12-12 00:28:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-12-12 00:28:17 +0800 |
| commit | 58c61be5b571c8fa346a26088deaa7ab3ec383ef (patch) | |
| tree | 0b705c70c07553b0838ece3e87ae22c68995c41b | |
| parent | 5bacf7c14d526aef3f344082fe6973423225917c (diff) | |
fix check target toolchains
| -rw-r--r-- | xmake/actions/config/main.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index b28488903..8490dd4e3 100644 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -21,6 +21,7 @@ -- imports import("core.base.option") import("core.base.global") +import("core.base.hashset") import("core.project.config") import("core.project.project") import("core.platform.platform") @@ -141,10 +142,14 @@ function _check_target_toolchains() -- @note we must check targets after loading options for _, target in pairs(project.targets()) do if target:get("enabled") ~= false and (target:get("toolchains") or not target:is_plat(config.get("plat"))) then + local target_toolchains = target:get("toolchains") + if target_toolchains then + target_toolchains = hashset.from(table.wrap(target_toolchains)) + end for _, toolchain_inst in pairs(target:toolchains()) do -- check toolchains for `target/set_toolchains()` - if target:get("toolchains") then - if not toolchain_inst:check() then + if target_toolchains then + if not toolchain_inst:check() and target_toolchains:has(toolchain_inst:name()) then raise("toolchain(\"%s\"): not found!", toolchain_inst:name()) end else |
