xmake.lua 1.2 KB

1234567891011121314151617181920212223242526
  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.3.2", "687148704f278c292962cffe1f440e5a4cc33f2a82f5e5a17b23aab88a282951")
  8. on_install(function (package)
  9. os.cp("sources/*.hpp", package:installdir("include/pyincpp"))
  10. end)
  11. on_test(function (package)
  12. assert(package:check_cxxsnippets({test = [[
  13. #include <cassert>
  14. using namespace pyincpp;
  15. void test() {
  16. Map<String, List<Integer>> map = {{"first", {123, 456}}, {"second", {789}}, {"second", {0}}, {"third", {"12345678987654321", 5}}};
  17. assert(map.size() == 3);
  18. assert(map.keys() == Set<String>({"first", "second", "third"}));
  19. assert(map["third"][-1].factorial() == 120);
  20. }
  21. ]]}, {configs = {languages = "c++17"}, includes = "pyincpp/pyincpp.hpp"}))
  22. end)