xmake.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package("glgpuselect")
  2. set_homepage("https://github.com/ArthurVasseur/GLGpuSelect")
  3. set_description("GLGpuSelect is a cross-platform drop-in replacement for opengl32.dll on Windows and libGL.so on Linux that enables per-application GPU selection ")
  4. set_license("GPL-3.0")
  5. add_urls("https://github.com/ArthurVasseur/GLGpuSelect/archive/refs/tags/$(version).zip",
  6. "https://github.com/ArthurVasseur/GLGpuSelect.git")
  7. add_versions("0.1.3", "44e30d7fecf70a73ce47ae37686270fafb363c6c19720cd6429550ff4425aff6")
  8. add_versions("0.1.2", "9c5ab5333f8b6acbcd1022943d6f2edd41727429ea063c8187137b3c6524aae7")
  9. add_versions("0.1.1", "29c9f2a0e879605abdf69e72ff008716dbba18865974761df5c887647b0ad774")
  10. add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
  11. add_configs("profiling", {description = "Build with tracy profiler", default = false, type = "boolean"})
  12. add_configs("asserts", {description = "Enable asserts", default = false, type = "boolean"})
  13. add_configs("logging", {description = "Enable logging", default = false, type = "boolean"})
  14. on_load(function (package)
  15. if package:config("profiling") then
  16. package:add("deps", "tracy")
  17. end
  18. package:add("deps", "concerto-core", {configs = {asserts = package:config("asserts")}})
  19. end)
  20. on_install("windows", function (package)
  21. local configs = {
  22. profiling = package:config("profiling"),
  23. asserts = package:config("asserts"),
  24. logging = package:config("logging"),
  25. }
  26. import("package.tools.xmake").install(package, configs)
  27. end)
  28. on_test(function (package)
  29. assert(package:check_cxxsnippets({test = [[
  30. #include <GLGpuSelect.h>
  31. void test() {
  32. uint32_t deviceCount = 0;
  33. uint32_t result = glgpusEnumerateDevices(&deviceCount, NULL);
  34. }
  35. ]]}, {configs = {languages = "cxx17"}}))
  36. end)