xmake.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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.4.0", "3f1f3a2b6fa5250405986b6cc4dff82299f866e2c6c2db75c7c3f38ecb91360f")
  8. add_deps("cmake", "boost")
  9. on_load(function (package)
  10. if not package:config("shared") then
  11. package:set("kind", "library", {headeronly = true})
  12. end
  13. end)
  14. on_install("windows", "linux", "macosx", "bsd", "mingw", "cross", function (package)
  15. local configs =
  16. {
  17. "-DYOMM2_ENABLE_TESTS=OFF",
  18. "-DYOMM2_ENABLE_EXAMPLES=OFF",
  19. "-DYOMM2_ENABLE_DOC=OFF",
  20. "-DYOMM2_ENABLE_BENCHMARKS=OFF",
  21. "-DYOMM2_ENABLE_TRACE=OFF",
  22. }
  23. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  24. table.insert(configs, "-DYOMM2_SHARED=" .. (package:config("shared") and "ON" or "OFF"))
  25. table.insert(configs, "-DYOMM2_DEBUG_MACROS=" .. (package:is_debug() and "ON" or "OFF"))
  26. import("package.tools.cmake").install(package, configs)
  27. end)
  28. on_test(function (package)
  29. assert(package:check_cxxsnippets({test = [[
  30. #include <yorel/yomm2/keywords.hpp>
  31. void test() {
  32. yorel::yomm2::update();
  33. }
  34. ]]}, {configs = {languages = "c++17"}}))
  35. end)