xmake.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package("vexcl")
  2. set_homepage("https://github.com/ddemidov/vexcl")
  3. set_description("VexCL is a C++ vector expression template library for OpenCL/CUDA/OpenMP")
  4. set_license("MIT")
  5. add_urls("https://github.com/ddemidov/vexcl/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/ddemidov/vexcl.git")
  7. add_versions("1.4.2", "3a2be30e303c4f44a269ca85de48f1a628127012f18abee0aa82c0c2cbb0e0c8")
  8. add_deps("cmake")
  9. add_deps("opencl-clhpp 1.x")
  10. add_deps("opencl", {system = true})
  11. add_deps("boost", {configs = {filesystem = true,
  12. date_time = true,
  13. program_options = true,
  14. system = true,
  15. thread = true,
  16. test = true}})
  17. if is_plat("windows") then
  18. add_defines("NOMINMAX")
  19. end
  20. on_install("windows", "linux", "macosx", function (package)
  21. local configs = {"-DVEXCL_BUILD_TESTS=OFF", "-DVEXCL_BUILD_EXAMPLES=OFF", "-DBoost_USE_STATIC_LIBS=ON"}
  22. if package:is_plat("windows") then
  23. table.insert(configs, "-DBoost_USE_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
  24. end
  25. import("package.tools.cmake").install(package, configs)
  26. end)
  27. on_test(function (package)
  28. assert(package:check_cxxsnippets({test = [[
  29. void test() {
  30. auto dev = vex::backend::device_list(vex::Filter::Any);
  31. }
  32. ]]}, {configs = {languages = "c++17"}, includes = "vexcl/devlist.hpp"}))
  33. end)