2
0

xmake.lua 986 B

123456789101112131415161718192021222324252627
  1. package("libnpy")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/llohse/libnpy")
  4. set_description("C++ library for reading and writing of numpy's .npy files")
  5. set_license("MIT")
  6. add_urls("https://github.com/llohse/libnpy/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/llohse/libnpy.git")
  8. add_versions("v1.0.1", "43452a4db1e8c1df606c64376ea1e32789124051d7640e7e4e8518ab4f0fba44")
  9. on_install(function (package)
  10. os.cp("include", package:installdir())
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({test = [[
  14. #include <vector>
  15. #include <string>
  16. #include <npy.hpp>
  17. void test() {
  18. const std::string path {"data.npy"};
  19. npy::npy_data d = npy::read_npy<double>(path);
  20. std::vector<double> data = d.data;
  21. }
  22. ]]}, {configs = {languages = "c++17"}}))
  23. end)