xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. package("intx")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/chfast/intx")
  4. set_description("Extended precision integer C++ library")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/chfast/intx/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/chfast/intx.git")
  8. add_versions("v0.11.0", "bff2a78e3a9a3b9bbabf50500feae65bc0ec50a2364f4a83768277d6eba7a844")
  9. add_deps("cmake")
  10. on_check(function (package)
  11. assert(package:check_cxxsnippets({test = [[
  12. #include <concepts>
  13. void test(std::signed_integral auto x) {}
  14. ]]}, {configs = {languages = "c++20"}}), "package(intx) Require at least C++20.")
  15. end)
  16. on_install(function (package)
  17. import("package.tools.cmake").install(package, {"-DINTX_TESTING=OFF"})
  18. end)
  19. on_test(function (package)
  20. assert(package:check_cxxsnippets({test = [[
  21. void test() {
  22. auto x = static_cast<int>(intx::uint512{1} / (intx::uint512{1} << 111));
  23. }
  24. ]]}, {configs = {languages = "c++20"}, includes = {"intx/intx.hpp"}}))
  25. end)