diff options
| author | ruki <[email protected]> | 2020-05-26 00:34:08 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-05-25 21:24:53 +0800 |
| commit | 97b53dfcb67c898f40fae06b6b939e4dac32a3a0 (patch) | |
| tree | c91bfc82592938ae27e2a72ec38737b33cd3988a /xmake/core/project/project.lua | |
| parent | 05b37be8865ff1af2051766a835e7576a6780e55 (diff) | |
add set_toolchains for target
Diffstat (limited to 'xmake/core/project/project.lua')
| -rw-r--r-- | xmake/core/project/project.lua | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 1c97bdfd4..be492e662 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -429,7 +429,7 @@ function project._load_targets() end end - -- laod packages + -- load packages t._PACKAGES = t._PACKAGES or {} for _, packagename in ipairs(table.wrap(t:get("packages"))) do local p = requires[packagename] @@ -437,6 +437,23 @@ function project._load_targets() table.insert(t._PACKAGES, p) end end + + -- load toolchains + local toolchains = t:get("toolchains") + if toolchains then + t._TOOLCHAINS = {} + for _, name in ipairs(table.wrap(toolchains)) do + local toolchain_inst, errors = toolchain.load(name) + -- attempt to load toolchain from project + if not toolchain_inst then + toolchain_inst = project.toolchain(name) + end + if not toolchain_inst then + return nil, errors + end + table.insert(t._TOOLCHAINS, toolchain_inst) + end + end end -- enter toolchains environment |
