xmake.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. add_rules("mode.debug", "mode.release")
  2. if is_plat("linux") then
  3. add_requires("libx11", "xorgproto")
  4. end
  5. target("glew")
  6. set_kind("$(kind)")
  7. if is_plat("windows", "mingw") then
  8. set_basename(is_kind("shared") and "glew32" or "glew32s")
  9. add_syslinks("glu32", "opengl32")
  10. elseif is_plat("macosx") then
  11. add_frameworks("OpenGL")
  12. elseif is_plat("linux") then
  13. add_syslinks("GL")
  14. add_packages("libx11", "xorgproto")
  15. end
  16. add_defines("GLEW_NO_GLU", {public = true})
  17. if is_plat("windows") then
  18. if is_kind("shared") then
  19. add_defines("GLEW_BUILD")
  20. else
  21. add_defines("GLEW_STATIC", {public = true})
  22. end
  23. elseif is_plat("mingw") and not is_kind("shared") then
  24. add_defines("GLEW_STATIC", {public = true})
  25. end
  26. add_files("src/glew.c")
  27. add_includedirs("include", {public = true})
  28. add_headerfiles("include/(GL/*.h)")
  29. target("glewinfo")
  30. set_kind("binary")
  31. add_deps("glew")
  32. if is_plat("windows", "mingw") then
  33. add_syslinks("user32", "gdi32", "glu32", "opengl32")
  34. elseif is_plat("macosx") then
  35. add_frameworks("OpenGL")
  36. elseif is_plat("linux") then
  37. add_syslinks("GL")
  38. add_packages("libx11", "xorgproto")
  39. end
  40. add_files("src/glewinfo.c")
  41. target("visualinfo")
  42. set_kind("binary")
  43. add_deps("glew")
  44. if is_plat("windows", "mingw") then
  45. add_syslinks("user32", "gdi32", "glu32", "opengl32")
  46. elseif is_plat("macosx") then
  47. add_frameworks("OpenGL")
  48. elseif is_plat("linux") then
  49. add_syslinks("GL")
  50. add_packages("libx11", "xorgproto")
  51. end
  52. add_files("src/visualinfo.c")