build.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package glfw
  2. /*
  3. // Windows Build Tags
  4. // ----------------
  5. // GLFW Options:
  6. #cgo windows CFLAGS: -D_GLFW_WIN32 -Iglfw/deps/mingw
  7. // Linker Options:
  8. #cgo windows LDFLAGS: -lgdi32
  9. #cgo !gles2,windows LDFLAGS: -lopengl32
  10. #cgo gles2,windows LDFLAGS: -lGLESv2
  11. // Darwin Build Tags
  12. // ----------------
  13. // GLFW Options:
  14. #cgo darwin CFLAGS: -D_GLFW_COCOA -Wno-deprecated-declarations
  15. // Linker Options:
  16. #cgo darwin LDFLAGS: -framework Cocoa -framework IOKit -framework CoreVideo
  17. #cgo !gles2,darwin LDFLAGS: -framework OpenGL
  18. #cgo gles2,darwin LDFLAGS: -lGLESv2
  19. // Linux Build Tags
  20. // ----------------
  21. // GLFW Options:
  22. #cgo linux,!wayland CFLAGS: -D_GLFW_X11
  23. #cgo linux,wayland CFLAGS: -D_GLFW_WAYLAND
  24. // Linker Options:
  25. #cgo linux,!gles1,!gles2,!gles3,!vulkan LDFLAGS: -lGL
  26. #cgo linux,gles1 LDFLAGS: -lGLESv1
  27. #cgo linux,gles2 LDFLAGS: -lGLESv2
  28. #cgo linux,gles3 LDFLAGS: -lGLESv3
  29. #cgo linux,vulkan LDFLAGS: -lvulkan
  30. #cgo linux,!wayland LDFLAGS: -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -lm -lXinerama -ldl -lrt
  31. #cgo linux,wayland LDFLAGS: -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon -lm -ldl -lrt
  32. // BSD Build Tags
  33. // ----------------
  34. // GLFW Options:
  35. #cgo freebsd,!wayland netbsd,!wayland openbsd pkg-config: x11 xau xcb xdmcp
  36. #cgo freebsd,wayland netbsd,wayland pkg-config: wayland-client wayland-cursor wayland-egl epoll-shim
  37. #cgo freebsd netbsd openbsd CFLAGS: -D_GLFW_HAS_DLOPEN
  38. #cgo freebsd,!wayland netbsd,!wayland openbsd CFLAGS: -D_GLFW_X11 -D_GLFW_HAS_GLXGETPROCADDRESSARB
  39. #cgo freebsd,wayland netbsd,wayland CFLAGS: -D_GLFW_WAYLAND
  40. // Linker Options:
  41. #cgo freebsd netbsd openbsd LDFLAGS: -lm
  42. */
  43. import "C"