xmake.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("pegtl")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/taocpp/PEGTL")
  4. set_description("Parsing Expression Grammar Template Library")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/taocpp/PEGTL/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/taocpp/PEGTL.git")
  8. add_versions("2.8.3", "88b8e4ded6ea1f3f2223cc3e37072e2db1e123b90d36c309816341ae9d966723")
  9. add_versions("3.2.2", "c6616275e78c618c016b79054eed0a0bdf4c1934f830d3ab33d3c3dac7320b03")
  10. add_versions("3.2.5", "4ecefe4151b14684a944dde57e68c98e00224e5fea055c263e1bfbed24a99827")
  11. add_versions("3.2.7", "d6cd113d8bd14e98bcbe7b7f8fc1e1e33448dc359e8cd4cca30e034ec2f0642d")
  12. add_versions("3.2.8", "319e8238daebc3a163f60c88c78922a8012772076fdd64a8dafaf5619cd64773")
  13. add_deps("cmake")
  14. if is_plat("linux") then
  15. add_extsources("apt::tao-pegtl-dev", "pacman::pegtl")
  16. elseif is_plat("macosx") then
  17. add_extsources("brew::pegtl")
  18. elseif is_plat("mingw") and is_subhost("msys") then
  19. add_extsources("pacman::pegtl")
  20. end
  21. on_install(function (package)
  22. import("package.tools.cmake").install(package, {"-DPEGTL_BUILD_TESTS=OFF", "-DPEGTL_BUILD_EXAMPLES=OFF"})
  23. end)
  24. on_test(function (package)
  25. assert(package:check_cxxsnippets({test = [[
  26. #include <tao/pegtl.hpp>
  27. void test(int argc, char *argv[]) {
  28. tao::pegtl::argv_input in(argv, 1);
  29. }
  30. ]]}, {configs = {languages = "c++17"}}))
  31. end)