summaryrefslogtreecommitdiff
path: root/xmake/scripts/tools/tools.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-12-05 00:33:03 +0800
committerruki <[email protected]>2015-12-05 00:33:03 +0800
commit98a12249aff0eed41c11f31da54205dc876379bf (patch)
tree65afbecb1ae45a65f1ac27cd74bd071a17b1577f /xmake/scripts/tools/tools.lua
parent95cc4b92a1b940058c2cc8f2bdf0e05ae222a33e (diff)
add dispatcher
Diffstat (limited to 'xmake/scripts/tools/tools.lua')
-rw-r--r--xmake/scripts/tools/tools.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/xmake/scripts/tools/tools.lua b/xmake/scripts/tools/tools.lua
index 8600a296f..31a68734b 100644
--- a/xmake/scripts/tools/tools.lua
+++ b/xmake/scripts/tools/tools.lua
@@ -35,7 +35,11 @@ function tools._match(name, toolname)
-- match full? ok
if name == toolname then return 100 end
-
+
+ -- match the name for windows? ok
+ if name:find("^" .. toolname .. "%.exe") then return 90 end
+ if name:find(toolname .. "%.exe") then return 85 end
+
-- match the last word? ok
if name:find(toolname .. "$") then return 80 end
@@ -75,7 +79,7 @@ function tools._find_from(root, name)
-- match score
local score = tools._match(name, toolname:lower())
-
+
-- ok?
if score >= 100 then return file end
@@ -173,7 +177,7 @@ function tools.load(name, root)
end
end
--- get the given tool from the current platform
+-- get the given tool script from the given kind
function tools.get(kind)
-- get the tool name