diff options
| author | ruki <[email protected]> | 2017-09-22 00:40:49 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-09-21 22:04:55 +0800 |
| commit | ab5456ca3457c7b59de6cc590068d91d7749d096 (patch) | |
| tree | 329742618ea8ef110542f27fa48f4226a20dde9c /xmake/modules/detect/tools/find_rc.lua | |
| parent | 034185734b5bc91f8188c15c9e02b0ce8ebaa850 (diff) | |
modify find_program interface
Diffstat (limited to 'xmake/modules/detect/tools/find_rc.lua')
| -rw-r--r-- | xmake/modules/detect/tools/find_rc.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xmake/modules/detect/tools/find_rc.lua b/xmake/modules/detect/tools/find_rc.lua index cc2696c45..6390118dc 100644 --- a/xmake/modules/detect/tools/find_rc.lua +++ b/xmake/modules/detect/tools/find_rc.lua @@ -41,15 +41,18 @@ import("lib.detect.find_programver") function main(opt) -- init options - opt = opt or {} + opt = opt or {} + opt.check = opt.check or "-?" + opt.command = opt.command or "-?" + 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 "rc.exe", opt.pathes, "-?") + local program = find_program(opt.program or "rc.exe", opt) -- find program version local version = nil if program and opt and opt.version then - version = find_programver(program, "-?", function (output) return output:match("Version (%d+%.?%d*%.?%d*.-)%s") end) + version = find_programver(program, opt) end -- ok? |
