summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-08-01 15:28:33 +0800
committerGitHub <[email protected]>2023-08-01 15:28:33 +0800
commit75cb0b3346bac8aca1b0effa95387e1587a52ae6 (patch)
tree76e4f613322ec97569b48aaef52cefcf61da73cf
parentae1dd341b914d6fd81f974251cfe278f660452d9 (diff)
parent0ad563bb85cc3875a4ebdf5c742696d00a25e451 (diff)
Merge pull request #4024 from sunxfancy/win_flex_bison
Add win_flex and win_bison binary support.
-rw-r--r--xmake/modules/detect/tools/find_bison.lua11
-rw-r--r--xmake/modules/detect/tools/find_flex.lua11
2 files changed, 6 insertions, 16 deletions
diff --git a/xmake/modules/detect/tools/find_bison.lua b/xmake/modules/detect/tools/find_bison.lua
index 6fafe1dc7..fcea71574 100644
--- a/xmake/modules/detect/tools/find_bison.lua
+++ b/xmake/modules/detect/tools/find_bison.lua
@@ -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
diff --git a/xmake/modules/detect/tools/find_flex.lua b/xmake/modules/detect/tools/find_flex.lua
index 3d127f9ab..640e606d0 100644
--- a/xmake/modules/detect/tools/find_flex.lua
+++ b/xmake/modules/detect/tools/find_flex.lua
@@ -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