xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. package("glad")
  2. set_homepage("https://glad.dav1d.de/")
  3. set_description("Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.")
  4. set_license("MIT")
  5. add_urls("https://github.com/Dav1dde/glad/archive/$(version).tar.gz",
  6. "https://github.com/Dav1dde/glad.git")
  7. add_versions("v0.1.34", "4be2900ff76ac71a2aab7a8be301eb4c0338491c7e205693435b09aad4969ecd")
  8. add_versions("v0.1.36", "8470ed1b0e9fbe88e10c34770505c8a1dc8ccb78cadcf673331aaf5224f963d2")
  9. if is_plat("linux") then
  10. add_syslinks("dl")
  11. end
  12. on_load("windows", "linux", "macosx", function (package)
  13. if not package.is_built or package:is_built() then
  14. package:add("deps", "cmake", "python 3.x", {kind = "binary"})
  15. end
  16. end)
  17. on_install("windows", "linux", "macosx", function (package)
  18. local configs = {"-DGLAD_INSTALL=ON", "-DGLAD_REPRODUCIBLE=ON"}
  19. if package:is_plat("windows") then
  20. table.insert(configs, "-DUSE_MSVC_RUNTIME_LIBRARY_DLL=" .. (package:config("vs_runtime"):startswith("MT") and "OFF" or "ON"))
  21. end
  22. import("package.tools.cmake").install(package, configs)
  23. end)
  24. on_test(function (package)
  25. assert(package:has_cfuncs("gladLoadGL", {includes = "glad/glad.h"}))
  26. end)