xmake.lua 1.4 KB

1234567891011121314151617181920212223242526272829
  1. package("pyincpp")
  2. set_homepage("https://github.com/chen-qingyu/pyincpp")
  3. set_description("A C++ type library that is as easy to use as Python built-in types.")
  4. set_kind("library", {headeronly = true})
  5. add_urls("https://github.com/chen-qingyu/pyincpp/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/chen-qingyu/pyincpp.git")
  7. add_versions("v1.6.0", "1e8e4bfde447c439974180e206087b309f50ac0e24aeddf39d21d73fd7067368")
  8. add_versions("v1.4.1", "f3de3b5044a5c640811e87782264acbaf14697cd8c35bb21ddcd4de5664a60d0")
  9. add_versions("v1.3.3", "2689349de9faa35d8bbefddcc7d29d49308a2badd58961cc2b1a8f80c96d0823")
  10. add_versions("v1.3.2", "687148704f278c292962cffe1f440e5a4cc33f2a82f5e5a17b23aab88a282951")
  11. on_install(function (package)
  12. os.cp("sources/*.hpp", package:installdir("include/pyincpp"))
  13. end)
  14. on_test(function (package)
  15. assert(package:check_cxxsnippets({test = [[
  16. #include <cassert>
  17. using namespace pyincpp;
  18. void test() {
  19. Map<String, List<Integer>> map = {{"first", {123, 456}}, {"second", {789}}, {"second", {0}}, {"third", {"12345678987654321", 5}}};
  20. assert(map.size() == 3);
  21. assert(map.keys() == Set<String>({"first", "second", "third"}));
  22. assert(map["third"][-1].factorial() == 120);
  23. }
  24. ]]}, {configs = {languages = "c++17"}, includes = "pyincpp/pyincpp.hpp"}))
  25. end)