xmake.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("think-cell-library")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://www.think-cell.com/en/career/devblog/overview")
  4. set_description("Think-cell core library")
  5. set_license("BSL-1.0")
  6. add_urls("https://github.com/think-cell/think-cell-library/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/think-cell/think-cell-library.git")
  8. add_versions("2023.1", "d5796bcef876e1260720961e31ebc537d9320d5e97b6d7ba6153b633da992756")
  9. add_deps("boost", {configs = {filesystem = true, container = true}})
  10. on_check("android", function (package)
  11. local ndk = package:toolchain("ndk"):config("ndkver")
  12. assert(ndk and tonumber(ndk) > 22, "package(think-cell-library) require ndk version > 22")
  13. end)
  14. on_install("!wasm", function (package)
  15. io.replace("tc/string/spirit.h", [[#include "spirit/x3.hpp"]], "#include <boost/spirit/home/x3.hpp>", {plain = true})
  16. os.cp("tc/**.h", package:installdir("include/tc"), {rootdir = "tc"})
  17. end)
  18. on_test(function (package)
  19. assert(package:check_cxxsnippets({test = [[
  20. #include <vector>
  21. #include <tc/range/meta.h>
  22. #include <tc/range/filter_adaptor.h>
  23. void test() {
  24. std::vector<int> v = {1,2,3,4};
  25. tc::for_each(tc::filter(v, [](const int& n){ return (n%2==0);}), [&](auto const& n) {});
  26. }
  27. ]]}, {configs = {languages = "c++20"}}))
  28. end)