xmake.lua 929 B

123456789101112131415161718192021222324
  1. package("gcem")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://www.kthohr.com/gcem.html")
  4. set_description("A C++ compile-time math library using generalized constant expressions")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/kthohr/gcem/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/kthohr/gcem.git")
  8. add_versions("v1.13.1", "69a1973f146a4a5e584193af062359f50bd5b948c4175d58ea2622e1c066b99b")
  9. add_deps("cmake")
  10. on_install("windows", "macosx", "linux", "mingw", function (package)
  11. import("package.tools.cmake").install(package)
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. void test() {
  16. constexpr int x = 10;
  17. constexpr int res = gcem::factorial(x);
  18. }
  19. ]]}, {configs = {languages = "c++11"}, includes = "gcem.hpp"}))
  20. end)