xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829
  1. package("functionalplus")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("http://www.editgym.com/fplus-api-search/")
  4. set_description("Functional Programming Library for C++. Write concise and readable C++ code.")
  5. add_urls("https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/Dobiasd/FunctionalPlus.git")
  7. add_versions("v0.2.18-p0", "ffc63fc86f89a205accafa85c35790eda307adf5f1d6d51bb7ceb5c5e21e013b")
  8. add_deps("cmake")
  9. on_install(function (package)
  10. local configs = {}
  11. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  12. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  13. import("package.tools.cmake").install(package, configs)
  14. end)
  15. on_test(function (package)
  16. assert(package:check_cxxsnippets({test = [[
  17. #include <fplus/fplus.hpp>
  18. #include <vector>
  19. bool func()
  20. {
  21. std::vector<std::string> things = {"same old", "same old"};
  22. return fplus::all_the_same(things);
  23. }
  24. ]]}, {configs = {languages = "c++17"}}))
  25. end)