xmake.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package("reactiveplusplus")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://victimsnino.github.io/ReactivePlusPlus/v2/docs/html/md_docs_2readme.html")
  4. set_description("Implementation of async observable/observer (Reactive Programming) in C++ with care about performance and templates in mind in ReactiveX approach")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/victimsnino/ReactivePlusPlus/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/victimsnino/ReactivePlusPlus.git")
  8. add_versions("v0.2.3", "9542419f8d7da98126ba2c6ae08fab287b4b3798d89cf75ed9bed2a9e3ec1678")
  9. add_deps("cmake")
  10. add_includedirs("include/rpp")
  11. on_install(function (package)
  12. import("package.tools.cmake").install(package, configs)
  13. end)
  14. on_test(function (package)
  15. local snippets
  16. if package:version():le("0.2.3") then
  17. snippets = [[
  18. void test() {
  19. rpp::source::just(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
  20. .filter([](int v) { return v % 2 == 0; })
  21. .subscribe([](int v) {});
  22. }
  23. ]]
  24. else
  25. snippets = [[
  26. void test() {
  27. rpp::source::just(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
  28. | rpp::operators::filter([](int v) { return v % 2 == 0; })
  29. | rpp::operators::subscribe([](int v) {});
  30. }
  31. ]]
  32. end
  33. assert(package:check_cxxsnippets({test = snippets}, {includes = "rpp/rpp.hpp", configs = {languages = "c++20"}}))
  34. end)