summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-09 22:53:03 +0800
committerruki <[email protected]>2024-07-09 22:53:03 +0800
commitc74b2ffe7cac1192bc6d567f5c2b9f086a78c6aa (patch)
treec056093bc01528d9952b9672513f079f5ad423a9 /xmake/modules
parent3f3fc063d40ca7114e21b511bb033d048a7af963 (diff)
fix ifx env
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/detect/tools/find_ifx.lua29
1 files changed, 24 insertions, 5 deletions
diff --git a/xmake/modules/detect/tools/find_ifx.lua b/xmake/modules/detect/tools/find_ifx.lua
index d6225d67f..135b74f06 100644
--- a/xmake/modules/detect/tools/find_ifx.lua
+++ b/xmake/modules/detect/tools/find_ifx.lua
@@ -37,10 +37,29 @@ import("lib.detect.find_programver")
--
function main(opt)
opt = opt or {}
- local program = find_program(opt.program or "ifx", opt)
- local version = nil
- if program and opt.version then
- version = find_programver(program, opt)
+ if is_host("windows") then
+ -- find program
+ opt.check = opt.check or function (program) os.runv(program, {"/help"}, {envs = opt.envs}) end
+ local program = find_program(opt.program or "ifx.exe", opt)
+
+ -- find program version
+ local version = nil
+ if program and opt and opt.version then
+ opt.command = opt.command or function () local _, info = os.iorunv(program, {"/help"}, {envs = opt.envs}); return info end
+ opt.parse = opt.parse or function (output) return output:match("Version (%d+%.?%d*%.?%d*.-)%s") end
+ version = find_programver(program, opt)
+ end
+ return program, version
+ else
+ -- find program
+ local program = find_program(opt.program or "ifx", opt)
+
+ -- find program version
+ local version = nil
+ if program and opt.version then
+ version = find_programver(program, opt)
+ end
+ return program, version
end
- return program, version
end
+