Skip to content

Commit

Permalink
fix flex
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Sep 18, 2024
1 parent 9286276 commit 5ba9ea7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/f/flex/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ package("flex")
-- we always set it, because flex may be modified as library
-- by add_deps("flex", {kind = "library"})
package:addenv("PATH", "bin")
if package:is_library() then
package:set("kind", "library", {headeronly = true})
end
end)

on_install("windows", function (package)
Expand All @@ -28,16 +31,13 @@ package("flex")

on_install("macosx", "linux", "bsd", "android", "iphoneos", "cross", function (package)
import("package.tools.autoconf").install(package)
if not package:is_binary() then
package:add("links", "")
end
end)

on_test(function (package)
if not package:is_cross() then
os.vrun("flex -h")
end
if not package:is_binary() then
if package:is_library() then
assert(package:has_cxxincludes("FlexLexer.h"))
end
end)
5 changes: 4 additions & 1 deletion packages/w/winflexbison/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ package("winflexbison")
-- we always set it, because flex may be modified as library
-- by add_deps("winflexbison", {kind = "library"})
package:addenv("PATH", "bin")
if package:config("flex") and package:is_library() then
package:set("kind", "library", {headeronly = true})
end
end)

on_install("windows", function (package)
Expand All @@ -42,7 +45,7 @@ package("winflexbison")
end
if package:config("flex") then
os.vrun("flex.exe -h")
if not package:is_binary() then
if package:is_library() then
assert(package:has_cxxincludes("FlexLexer.h"))
end
end
Expand Down

0 comments on commit 5ba9ea7

Please sign in to comment.