diff options
Diffstat (limited to 'xmake/core/tool/tool.lua')
| -rw-r--r-- | xmake/core/tool/tool.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua index 3846dc499..d16d27a7b 100644 --- a/xmake/core/tool/tool.lua +++ b/xmake/core/tool/tool.lua @@ -124,10 +124,13 @@ end -- load the given tool from the given shell name function tool._load(shellname, kind) + -- calculate the cache key + local key = shellname .. (kind or "") + -- get it directly from cache dirst tool._TOOLS = tool._TOOLS or {} - if tool._TOOLS[shellname] then - return tool._TOOLS[shellname] + if tool._TOOLS[key] then + return tool._TOOLS[key] end -- find the tool script path @@ -170,7 +173,7 @@ function tool._load(shellname, kind) end -- save tool to the cache - tool._TOOLS[shellname] = module + tool._TOOLS[key] = module -- ok? return module |
