diff options
| author | ruki <[email protected]> | 2020-12-15 00:44:32 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-12-15 00:44:32 +0800 |
| commit | 99a7d26748e8afa84fa7123344f6aa4d24a1be93 (patch) | |
| tree | aeaa96d72eea4170ec46f89f85189f03cb9393d5 /xmake/core/tool/toolchain.lua | |
| parent | a6f93e44186006e0ee73450937608ec24fef192e (diff) | |
fix check vs
Diffstat (limited to 'xmake/core/tool/toolchain.lua')
| -rw-r--r-- | xmake/core/tool/toolchain.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua index adb17c865..327be29ed 100644 --- a/xmake/core/tool/toolchain.lua +++ b/xmake/core/tool/toolchain.lua @@ -46,6 +46,15 @@ function _instance.new(name, info, cachekey, configs) for k, v in pairs(configs) do instance._CONFIGS[k] = v end + -- is global toolchain for the whole platform? + configs.plat = nil + configs.arch = nil + configs.cachekey = nil + local plat = config.get("plat") or os.host() + local arch = config.get("arch") or os.arch() + if instance:is_plat(plat) and instance:is_arch(arch) and #table.keys(configs) == 0 then + instance._CONFIGS.__global = true + end return instance end @@ -137,6 +146,11 @@ function _instance:standalone() return self:kind() == "standalone" end +-- global toolchain for whole platform +function _instance:global() + return self:config("__global") +end + -- get the run environments function _instance:runenvs() local runenvs = self._RUNENVS |
