diff --git a/xmake/modules/detect/tools/find_flex.lua b/xmake/modules/detect/tools/find_flex.lua index 12ee4365a1..640e606d05 100644 --- a/xmake/modules/detect/tools/find_flex.lua +++ b/xmake/modules/detect/tools/find_flex.lua @@ -38,13 +38,9 @@ import("lib.detect.find_programver") function main(opt) opt = opt or {} local program = find_program(opt.program or "flex", opt) - - -- try win_flex if flex is not found on windows - if not program and is_host("windows") then + if not program and not opt.program and is_host("windows") then program = find_program("win_flex", opt) end - - -- find program version local version = nil if program and opt and opt.version then version = find_programver(program, opt)