xmake.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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("v2.1.1", "0b962478d7c973a1f74062ce7f8d24c2fdcd2733031b1f014e65d252d59ebe6a",
  9. "v2.1.0", "d84a194ef96b92201ea574f81780837c95e8956bbad09b3dc2dc5cef7c2eef98",
  10. "v0.2.3", "9542419f8d7da98126ba2c6ae08fab287b4b3798d89cf75ed9bed2a9e3ec1678")
  11. add_deps("cmake")
  12. add_includedirs("include/rpp")
  13. on_install(function (package)
  14. import("package.tools.cmake").install(package, configs)
  15. end)
  16. on_test(function (package)
  17. local snippets
  18. if package:version() and package:version():le("0.2.3") then
  19. snippets = [[
  20. void test() {
  21. rpp::source::just(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
  22. .filter([](int v) { return v % 2 == 0; })
  23. .subscribe([](int v) {});
  24. }
  25. ]]
  26. else
  27. snippets = [[
  28. void test() {
  29. rpp::source::just(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
  30. | rpp::operators::filter([](int v) { return v % 2 == 0; })
  31. | rpp::operators::subscribe([](int v) {});
  32. }
  33. ]]
  34. end
  35. assert(package:check_cxxsnippets({test = snippets}, {includes = "rpp/rpp.hpp", configs = {languages = "c++20"}}))
  36. end)