xmake.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package("cuda-samples")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/NVIDIA/cuda-samples")
  4. set_description("CUDA Sample Utility Code")
  5. set_license("BSD-3-Clause")
  6. add_urls("https://github.com/NVIDIA/cuda-samples/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/NVIDIA/cuda-samples.git")
  8. add_versions("v13.1", "03d7748a773fcd2350c2de88f2d167252c78ea90a52e229e7eb2a6922e3ba350")
  9. add_versions("v13.0", "63cc9d5d8280c87df3c1f4e2276234a0f42cc497c52b40dd5bdda2836607db79")
  10. add_versions("v12.9", "2e67e1f6bdb15bf11b21e07e988e2f9f60fb054eff51ef01cebdd47229788015")
  11. add_versions("v12.8", "fe82484f9a87334075498f4e023a304cc70f240a285c11678f720f0a1e54a89d")
  12. add_versions("v12.5", "5c40cc096706045b067ec5897f039403014aa7a39b970905698466a2d029b972")
  13. add_versions("v12.4.1", "01bb311cc8f802a0d243700e4abe6a2d402132c9d97ecf2c64f3fbb1006c304c")
  14. add_versions("v11.8", "1bc02c0ca42a323f3c7a05b5682eae703681a91e95b135bfe81f848b2d6a2c51")
  15. add_versions("v12.3", "a40e4d3970185f38477dd8b5bdbd81642b04648d8b812af914333b8f83355efe")
  16. on_fetch(function (package, opt)
  17. if opt.system and package:is_plat("windows") then
  18. import("lib.detect.find_path")
  19. local paths = {
  20. "C:\\ProgramData\\NVIDIA Corporation\\CUDA Samples\\v*\\common"
  21. }
  22. local headerpath = find_path("helper_cuda.h", paths, {suffixes = {"inc"}})
  23. if headerpath then
  24. vprint("CUDA Samples Found: " .. path.directory(headerpath))
  25. return {includedirs = {headerpath}}
  26. end
  27. end
  28. end)
  29. add_includedirs("include/Common")
  30. on_install(function (package)
  31. os.cp("Common", package:installdir("include"))
  32. end)
  33. on_test(function (package)
  34. assert(os.isfile(path.join(package:installdir("include"), "Common", "helper_cuda.h")))
  35. end)