xmake.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package("yomm2")
  2. set_homepage("https://github.com/jll63/yomm2")
  3. set_description("Fast, orthogonal, open multi-methods. Solve the Expression Problem in C++17.")
  4. set_license("BSL-1.0")
  5. add_urls("https://github.com/jll63/yomm2/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/jll63/yomm2.git")
  7. add_versions("v1.5.2", "12f3f735b4870606199b889a242ebfed84cf0cd392b04a1c32db11291de684be")
  8. add_versions("v1.5.1", "323abba27a356555cc3ead3e3e950746ab43f90d97ad21950f2ba3afaf565ecc")
  9. add_versions("v1.5.0", "daebc9bc56e3f67f1513c40b4b185cf435d8e16fe9936f3e5ed6fbb337a39030")
  10. add_versions("v1.4.0", "3f1f3a2b6fa5250405986b6cc4dff82299f866e2c6c2db75c7c3f38ecb91360f")
  11. add_deps("cmake", "boost")
  12. on_load(function (package)
  13. if not package:config("shared") then
  14. package:set("kind", "library", {headeronly = true})
  15. end
  16. end)
  17. on_install("windows", "linux", "macosx", "bsd", "mingw", "cross", function (package)
  18. io.replace("CMakeLists.txt", "add_subdirectory(docs.in)", "", {plain = true})
  19. local configs =
  20. {
  21. "-DYOMM2_ENABLE_TESTS=OFF",
  22. "-DYOMM2_ENABLE_EXAMPLES=OFF",
  23. "-DYOMM2_ENABLE_DOC=OFF",
  24. "-DYOMM2_ENABLE_BENCHMARKS=OFF",
  25. "-DYOMM2_ENABLE_TRACE=OFF",
  26. }
  27. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  28. table.insert(configs, "-DYOMM2_SHARED=" .. (package:config("shared") and "ON" or "OFF"))
  29. table.insert(configs, "-DYOMM2_DEBUG_MACROS=" .. (package:is_debug() and "ON" or "OFF"))
  30. import("package.tools.cmake").install(package, configs)
  31. end)
  32. on_test(function (package)
  33. assert(package:check_cxxsnippets({test = [[
  34. #include <yorel/yomm2/keywords.hpp>
  35. void test() {
  36. yorel::yomm2::update();
  37. }
  38. ]]}, {configs = {languages = "c++17"}}))
  39. end)