xmake.lua 921 B

123456789101112131415161718192021
  1. package("nvapi")
  2. set_homepage("https://github.com/NVIDIA/nvapi")
  3. set_description("NVAPI is NVIDIA's core software development kit that allows direct access to NVIDIA GPUs and drivers on supported platforms.")
  4. add_urls("https://github.com/NVIDIA/nvapi.git")
  5. add_versions("2025.12.18", "832a3673d66a0fdf6d6e522468821d5cbd925f23")
  6. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  7. on_install("windows|!arm*", function (package)
  8. os.cp("*.h", package:installdir("include"))
  9. if package:check_sizeof("void*") == "8" then
  10. os.cp("amd64/nvapi64.lib", package:installdir("lib"))
  11. else
  12. os.cp("x86/nvapi.lib", package:installdir("lib"))
  13. end
  14. end)
  15. on_test(function (package)
  16. assert(package:has_cxxfuncs("NvAPI_Initialize", {includes = {"windows.h", "nvapi.h"}}))
  17. end)