xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. package("blitz")
  2. set_homepage("https://github.com/blitzpp/blitz")
  3. set_description("Blitz++ Multi-Dimensional Array Library for C++")
  4. set_license("LGPL-3.0")
  5. add_urls("https://github.com/blitzpp/blitz/archive/refs/tags/$(version).zip",
  6. "https://github.com/blitzpp/blitz.git")
  7. add_versions("1.0.2", "a477b9692a47363fce5929bba6d6d230773ddfbb020ce6841f7a961a55b9e71f")
  8. if is_plat("windows") then
  9. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  10. end
  11. add_deps("cmake")
  12. add_deps("python 3.x", {kind = "binary"})
  13. on_install("windows", "macosx", "linux", function (package)
  14. io.replace("src/CMakeLists.txt", "SHARED", package:config("shared") and "SHARED" or "STATIC", {plain = true})
  15. io.replace("src/CMakeLists.txt", "NOT WIN32", "FALSE", {plain = true})
  16. import("package.tools.cmake").install(package)
  17. end)
  18. on_test(function (package)
  19. assert(package:check_cxxsnippets({test = [[
  20. void test() {
  21. blitz::Array<double, 1> x(100);
  22. x = blitz::tensor::i;
  23. blitz::Array<double, 1> y(x + 150);
  24. blitz::Array<double, 1> z(x + y * 2);
  25. }
  26. ]]}, {configs = {languages = "c++11"}, includes = "blitz/array.h"}))
  27. end)