xmake.lua 917 B

12345678910111213141516171819202122232425
  1. package("flux")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://tristanbrindle.com/flux/")
  4. set_description("A C++20 library for sequence-orientated programming")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/tcbrindle/flux.git")
  7. add_versions("2023.08.17", "8434e8e0fd131cebc3aed0d845530335bf7fb5e1")
  8. on_install(function (package)
  9. os.cp("include", package:installdir())
  10. end)
  11. on_test(function (package)
  12. assert(package:check_cxxsnippets({test = [[
  13. #include <flux.hpp>
  14. void test() {
  15. constexpr auto result = flux::from(std::array{1, 2, 3, 4, 5})
  16. .filter(flux::pred::even)
  17. .map([](int i) { return i * 2; })
  18. .sum();
  19. static_assert(result == 12);
  20. }
  21. ]]}, {configs = {languages = "c++20"}}))
  22. end)