xmake.lua 1020 B

123456789101112131415161718192021222324252627282930
  1. package("cnl")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/johnmcfarlane/cnl")
  4. set_description("A Compositional Numeric Library for C++")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/johnmcfarlane/cnl.git")
  7. add_versions("2023.12.23", "7b6172f3d657147964079e91d078302d853419c5")
  8. add_deps("cmake")
  9. if on_check then
  10. on_check("android", function (package)
  11. local ndk = package:toolchain("ndk"):config("ndkver")
  12. assert(ndk and tonumber(ndk) > 22, "package(cnl) require ndk version > 22")
  13. end)
  14. end
  15. on_install(function (package)
  16. io.replace("CMakeLists.txt", [[add_subdirectory("test")]], "", {plain = true})
  17. import("package.tools.cmake").install(package, {
  18. "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")
  19. })
  20. end)
  21. on_test(function (package)
  22. assert(package:has_cxxincludes("cnl/all.h", {configs = {languages = "c++20"}}))
  23. end)