xmake.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package("re-flex")
  2. set_homepage("https://www.genivia.com/doc/reflex/html")
  3. set_description("A high-performance C++ regex library and lexical analyzer generator with Unicode support.")
  4. set_license("BSD-3-Clause")
  5. add_urls("https://github.com/Genivia/RE-flex/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/Genivia/RE-flex.git")
  7. add_versions("v4.3.0", "1658c1be9fa95bf948a657d75d2cef0df81b614bc6052284935774d4d8551d95")
  8. on_install(function (package)
  9. io.writefile("xmake.lua",[[
  10. add_rules("mode.debug", "mode.release")
  11. set_languages("cxx11")
  12. add_includedirs("include")
  13. set_encodings("utf-8")
  14. add_vectorexts("all")
  15. target("re-flex")
  16. set_kind("$(kind)")
  17. add_headerfiles("include/(reflex/*.h)")
  18. add_files("lib/*.cpp")
  19. add_files("unicode/*.cpp")
  20. if is_plat("windows") and is_kind("shared") then
  21. add_rules("utils.symbols.export_all", {export_classes = true})
  22. end
  23. target("reflex")
  24. set_kind("binary")
  25. add_files("src/*.cpp")
  26. add_deps("re-flex")
  27. ]])
  28. import("package.tools.xmake").install(package)
  29. package:addenv("PATH", "bin")
  30. end)
  31. on_test(function (package)
  32. assert(package:check_cxxsnippets({test = [[
  33. #include <reflex/matcher.h>
  34. void test() {
  35. reflex::Matcher matcher("\w+","114 514 1919 810");
  36. }
  37. ]]}, {configs = {languages = "cxx11"}}))
  38. end)