diff options
| author | ruki <[email protected]> | 2020-06-20 12:38:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-06-20 12:38:44 +0800 |
| commit | 281e06a020f7704fe998be52a6ecc2711cfd4fb7 (patch) | |
| tree | 7296f3837d062dcdf6031b821dc6ea0ff1c8986d /xmake/core/tool/toolchain.lua | |
| parent | 01dd21d4f3bccda1ff18ad1213b959feeaae37eb (diff) | |
improve to find cl/link
Diffstat (limited to 'xmake/core/tool/toolchain.lua')
| -rw-r--r-- | xmake/core/tool/toolchain.lua | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua index 12470394b..e405fe1f8 100644 --- a/xmake/core/tool/toolchain.lua +++ b/xmake/core/tool/toolchain.lua @@ -161,23 +161,6 @@ function _instance:sdkdir() return config.get("sdk") or self:get("sdkdir") end --- do load, @note we need load it repeatly for each architectures -function _instance:_load() - local info = self:info() - if not info:get("__loaded") and not info:get("__loading") then - local on_load = info:get("load") - if on_load then - info:set("__loading", true) - local ok, errors = sandbox.load(on_load, self) - info:set("__loading", false) - if not ok then - os.raise(errors) - end - end - info:set("__loaded", true) - end -end - -- do check, we only check it once for all architectures function _instance:check() local checkok = true @@ -196,6 +179,23 @@ function _instance:check() return checkok end +-- do load, @note we need load it repeatly for each architectures +function _instance:_load() + local info = self:info() + if not info:get("__loaded") and not info:get("__loading") then + local on_load = info:get("load") + if on_load then + info:set("__loading", true) + local ok, errors = sandbox.load(on_load, self) + info:set("__loading", false) + if not ok then + os.raise(errors) + end + end + info:set("__loaded", true) + end +end + -- get the tool description from the tool kind function _instance:_description(toolkind) local descriptions = self._DESCRIPTIONS @@ -262,7 +262,7 @@ function _instance:_checktool(toolkind, toolpath) -- find tool program local program, toolname - local tool = find_tool(toolpath, {program = toolpath, pathes = self:bindir()}) + local tool = find_tool(toolpath, {program = toolpath, pathes = self:bindir(), envs = self:get("runenvs")}) if tool then program = tool.program toolname = tool.name |
