diff options
| -rw-r--r-- | xmake/modules/detect/tools/find_cl.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/modules/detect/tools/find_cl.lua b/xmake/modules/detect/tools/find_cl.lua index c7f92c8e4..bbf00cde2 100644 --- a/xmake/modules/detect/tools/find_cl.lua +++ b/xmake/modules/detect/tools/find_cl.lua @@ -43,8 +43,6 @@ function main(opt) -- init options opt = opt or {} opt.check = opt.check or function (program) os.run(program) end - opt.command = opt.command or function () local _, info = os.iorun(program); return info end - opt.parse = opt.parse or function (output) return output:match("Version (%d+%.?%d*%.?%d*.-)%s") end -- find program local program = find_program(opt.program or "cl.exe", opt) @@ -52,7 +50,9 @@ function main(opt) -- find program version local version = nil if program and opt and opt.version then - version = find_programver(program, opt) + opt.command = opt.command or function () local _, info = os.iorun(program); 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 -- ok? |
