xmake.lua 1.1 KB

123456789101112131415161718192021222324252627282930
  1. package("opencl-clhpp")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/KhronosGroup/OpenCL-CLHPP/")
  4. set_description("OpenCL API C++ bindings")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/KhronosGroup/OpenCL-$(version)", {version = function (version)
  7. if version:ge("2.0") then
  8. return "CLHPP/archive/refs/tags/v" .. version .. ".tar.gz"
  9. else
  10. return "Registry.git"
  11. end
  12. end})
  13. add_versions("2.0.15", "0175806508abc699586fc9a9387e01eb37bf812ca534e3b493ff3091ec2a9246")
  14. add_versions("1.2.8", "2a35cdc00e31234fa8e5306adc61d8944a810c90")
  15. add_deps("opencl", {system = true})
  16. on_install(function (package)
  17. if package:version():ge("2.0") then
  18. os.cp("include/CL", package:installdir("include"))
  19. else
  20. os.cp("api/2.1/cl.hpp", package:installdir("include", "CL"))
  21. end
  22. end)
  23. on_test(function (package)
  24. assert(package:has_cxxtypes("cl::Platform", {configs = {languages = "c++14"}, includes = (package:version():ge("2.0") and "CL/opencl.hpp" or "CL/cl.hpp")}))
  25. end)