2
0

xmake.lua 1.0 KB

123456789101112131415161718192021222324252627
  1. package("numcpp")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/dpilger26/NumCpp")
  4. set_description("C++ implementation of the Python Numpy library")
  5. set_license("MIT")
  6. add_urls("https://github.com/dpilger26/NumCpp/archive/refs/tags/Version_$(version).tar.gz",
  7. "https://github.com/dpilger26/NumCpp.git")
  8. add_versions("2.4.2", "8da0494552796b76e5e9ef691176fa7cb27bc52fec4019da20bfd8fb7ba00b91")
  9. add_deps("cmake")
  10. add_deps("boost")
  11. on_install("windows", "macosx", "linux", function (package)
  12. import("package.tools.cmake").install(package)
  13. end)
  14. on_test(function (package)
  15. assert(package:check_cxxsnippets({test = [[
  16. void test() {
  17. nc::NdArray<int> a0 = {{1, 2}, {3, 4}};
  18. nc::NdArray<int> a1 = {{1, 2}, {3, 4}, {5, 6}};
  19. a1.reshape(2, 3);
  20. auto a2 = a1.astype<double>();
  21. }
  22. ]]}, {configs = {languages = "c++17"}, includes = "NumCpp.hpp"}))
  23. end)