diff options
Diffstat (limited to 'xmake/modules/lib/detect/find_tool.lua')
| -rw-r--r-- | xmake/modules/lib/detect/find_tool.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/modules/lib/detect/find_tool.lua b/xmake/modules/lib/detect/find_tool.lua index 74d446bb4..0911bea20 100644 --- a/xmake/modules/lib/detect/find_tool.lua +++ b/xmake/modules/lib/detect/find_tool.lua @@ -29,9 +29,17 @@ import("lib.detect.find_programver") -- find tool from modules function _find_from_modules(name, opt) + -- strip arguments with spaces + name = name:split("%s+")[1] + -- replace "+" to "x" name = name:gsub("%+", "x") + -- strip suffix on windows + if os.host() == "windows" and name:endswith(".exe") then + name = name:sub(1, #name - 4) + end + -- "detect.tool.find_xxx" exists? if os.isfile(path.join(os.programdir(), "modules", "detect", "tool", "find_" .. name .. ".lua")) then local find_tool = import("detect.tool.find_" .. name) |
