diff options
| author | ruki <[email protected]> | 2017-02-22 21:42:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-02-22 21:42:25 +0800 |
| commit | b69ebb909d9f62f1300d75067938e98d4d7ae36a (patch) | |
| tree | 20ee05babd6bc9a700f2264ac7b46857922d9604 /xmake/core/tool/tool.lua | |
| parent | 28519b50187de9a1f69900c8ab58c73e3a54707c (diff) | |
improve check for macosx
Diffstat (limited to 'xmake/core/tool/tool.lua')
| -rw-r--r-- | xmake/core/tool/tool.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua index a873cc0ba..d73ccfb13 100644 --- a/xmake/core/tool/tool.lua +++ b/xmake/core/tool/tool.lua @@ -246,8 +246,16 @@ function tool.check(shellname, dirs, check) -- check assert(shellname) - -- attempt to check it directly first + -- attempt to get result from cache first + tool._CHECKINFO = tool._CHECKINFO or {} + local result = tool._CHECKINFO[shellname] + if result then + return result + end + + -- attempt to check it directly if tool._check(shellname, check) then + tool._CHECKINFO[shellname] = shellname return shellname end @@ -261,6 +269,7 @@ function tool.check(shellname, dirs, check) -- check it if tool._check(toolpath, check) then + tool._CHECKINFO[shellname] = toolpath return toolpath end end |
