xmake.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. package("step20")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/storm-ptr/step20")
  4. set_description("Step20 is a C++20, header-only library of STL-like algorithms and data structures")
  5. set_license("MIT")
  6. add_urls("https://github.com/storm-ptr/step20.git")
  7. add_versions("2023.08.21", "4b163b99f05da6de96fe67879c200d80055adc87")
  8. if on_check then
  9. on_check("android", function (package)
  10. local ndk = package:toolchain("ndk")
  11. local ndkver = ndk:config("ndkver")
  12. assert(ndkver and tonumber(ndkver) > 22, "package(step20) require ndk version > 22")
  13. end)
  14. end
  15. on_install(function (package)
  16. os.cp("*.hpp", package:installdir("include/step20"))
  17. os.cp("detail/*.hpp", package:installdir("include/step20/detail"))
  18. end)
  19. on_test(function (package)
  20. assert(package:check_cxxsnippets({test = [[
  21. #include <step20/to.hpp>
  22. #include <array>
  23. #include <vector>
  24. void test() {
  25. std::array arr{1, 2, 3, 4, 5};
  26. auto vec = step20::to<std::vector<int>>(arr);
  27. }
  28. ]]}, {configs = {languages = "c++20"}}))
  29. end)