xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728
  1. package("ring-span-lite")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/martinmoene/ring-span-lite")
  4. set_description("ring-span lite - A C++yy-like ring_span type for C++98, C++11 and later in a single-file header-only library")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/martinmoene/ring-span-lite/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/martinmoene/ring-span-lite.git")
  8. add_versions("v0.7.0", "7650bb1bcf76cb0f7ac75240c5346203cbe7eb7027c0843c60253f6db08a93c1")
  9. add_deps("cmake")
  10. on_install(function (package)
  11. import("package.tools.cmake").install(package, {"-DRING_SPAN_LITE_OPT_BUILD_TESTS=OFF"})
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. template< typename T, size_t N >
  16. inline size_t dim( T (&arr)[N] ) { return N; }
  17. void test() {
  18. double arr[] = { 2.0 , 3.0, 5.0, };
  19. double coeff[] = { 0.25, 0.5, 0.25 };
  20. nonstd::ring_span<double> buffer( arr, arr + dim(arr), arr, dim(arr) );
  21. }
  22. ]]}, {includes = "nonstd/ring_span.hpp"}))
  23. end)