xmake.lua 965 B

123456789101112131415161718192021222324252627
  1. package("fastmod")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/lemire/fastmod")
  4. set_description("A header file for fast 32-bit division remainders on 64-bit hardware.")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/lemire/fastmod/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/lemire/fastmod.git")
  8. add_versions("v0.1.0", "b80e759208d6b4318caa14b1851352c69e8c7a1f7895639e3af1d86944d2973b")
  9. add_deps("cmake")
  10. on_check(function (package)
  11. if package:check_sizeof("void*") == "4" then
  12. raise("package(fastmod) unsupported 32-bit")
  13. end
  14. end)
  15. on_install(function (package)
  16. io.replace("CMakeLists.txt", "add_subdirectory(tests)", "", {plain = true})
  17. import("package.tools.cmake").install(package)
  18. end)
  19. on_test(function (package)
  20. assert(package:has_cfuncs("fastmod_u32", {includes = "fastmod.h"}))
  21. end)