diff options
| author | ruki <[email protected]> | 2020-10-07 00:53:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-10-07 00:53:57 +0800 |
| commit | ed9243b5b503c00057b10efb7cf6ee82eb9c35c5 (patch) | |
| tree | 200070c6ba5b56b06c71bf4f6f47f66a577e1c60 /xmake/modules/detect/tools/find_icl.lua | |
| parent | acc4c79235d585c6c3f05aaf3d2c6e11adb076ff (diff) | |
support icl for windows
Diffstat (limited to 'xmake/modules/detect/tools/find_icl.lua')
| -rw-r--r-- | xmake/modules/detect/tools/find_icl.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/modules/detect/tools/find_icl.lua b/xmake/modules/detect/tools/find_icl.lua index f61f0ce76..ac0008c0e 100644 --- a/xmake/modules/detect/tools/find_icl.lua +++ b/xmake/modules/detect/tools/find_icl.lua @@ -38,15 +38,19 @@ import("lib.detect.find_programver") function main(opt) -- init options - opt = opt or {} + opt = opt or {} + opt.check = opt.check or function (program) os.runv(program, {"/help"}, {envs = opt.envs}) end -- find program - local program = find_program(opt.program or "icl", opt) + local program = find_program(opt.program or "icl.exe", opt) -- find program version local version = nil - if program and opt.version then - version = find_programver(program, opt) + 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 end + |
