Skip to content

Commit

Permalink
Merge pull request #4024 from sunxfancy/win_flex_bison
Browse files Browse the repository at this point in the history
Add win_flex and win_bison binary support.
  • Loading branch information
waruqi committed Aug 1, 2023
2 parents ae1dd34 + 0ad563b commit 75cb0b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
11 changes: 3 additions & 8 deletions xmake/modules/detect/tools/find_bison.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,14 @@ import("lib.detect.find_programver")
-- @endcode
--
function main(opt)

-- init options
opt = opt or {}

-- find program
local program = find_program(opt.program or "bison", opt)

-- find program version
if not program and not opt.program and is_host("windows") then
program = find_program("win_bison", opt)
end
local version = nil
if program and opt and opt.version then
version = find_programver(program, opt)
end

-- ok?
return program, version
end
11 changes: 3 additions & 8 deletions xmake/modules/detect/tools/find_flex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,14 @@ import("lib.detect.find_programver")
-- @endcode
--
function main(opt)

-- init options
opt = opt or {}

-- find program
local program = find_program(opt.program or "flex", opt)

-- find program version
if not program and not opt.program and is_host("windows") then
program = find_program("win_flex", opt)
end
local version = nil
if program and opt and opt.version then
version = find_programver(program, opt)
end

-- ok?
return program, version
end

0 comments on commit 75cb0b3

Please sign in to comment.