From 98a12249aff0eed41c11f31da54205dc876379bf Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 5 Dec 2015 00:33:03 +0800 Subject: add dispatcher --- xmake/scripts/tools/tools.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'xmake/scripts/tools/tools.lua') 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 -- cgit v1.3.1