diff --git a/internal/cglfw/build.go b/internal/cglfw/build.go deleted file mode 100644 index 8853b0ee3..000000000 --- a/internal/cglfw/build.go +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// SPDX-FileCopyrightText: 2012 The glfw3-go Authors -// SPDX-FileCopyrightText: 2023 The Ebitengine Authors - -//go:build darwin || freebsd || linux || netbsd || openbsd - -package cglfw - -/* -// Darwin Build Tags -// ---------------- -// GLFW Options: -#cgo darwin CFLAGS: -D_GLFW_COCOA -Wno-deprecated-declarations - -// Linker Options: -#cgo darwin LDFLAGS: -framework Cocoa -framework IOKit -framework CoreVideo - -// Linux Build Tags -// ---------------- -// GLFW Options: -#cgo linux,!wayland CFLAGS: -D_GLFW_X11 -#cgo linux,wayland CFLAGS: -D_GLFW_WAYLAND - -// Linker Options: -#cgo linux,!wayland LDFLAGS: -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -lm -lXinerama -ldl -lrt -#cgo linux,wayland LDFLAGS: -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon -lm -ldl -lrt - -// BSD Build Tags -// ---------------- -// GLFW Options: -#cgo freebsd,!wayland netbsd,!wayland openbsd pkg-config: x11 xau xcb xdmcp -#cgo freebsd,wayland netbsd,wayland pkg-config: wayland-client wayland-cursor wayland-egl epoll-shim -#cgo freebsd netbsd openbsd CFLAGS: -D_GLFW_HAS_DLOPEN -#cgo freebsd,!wayland netbsd,!wayland openbsd CFLAGS: -D_GLFW_X11 -D_GLFW_HAS_GLXGETPROCADDRESSARB -#cgo freebsd,wayland netbsd,wayland CFLAGS: -D_GLFW_WAYLAND - -// Linker Options: -#cgo freebsd netbsd openbsd LDFLAGS: -lm -*/ -import "C" diff --git a/internal/cglfw/build_bsd.go b/internal/cglfw/build_bsd.go new file mode 100644 index 000000000..b4898bcb6 --- /dev/null +++ b/internal/cglfw/build_bsd.go @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: BSD-3-Clause +// SPDX-FileCopyrightText: 2012 The glfw3-go Authors +// SPDX-FileCopyrightText: 2023 The Ebitengine Authors + +//go:build freebsd || netbsd || openbsd + +package cglfw + +import "C" + +// #cgo !wayland openbsd pkg-config: x11 xau xcb xdmcp +// #cgo wayland,!openbsd pkg-config: wayland-client wayland-cursor wayland-egl epoll-shim +// #cgo CFLAGS: -D_GLFW_HAS_DLOPEN +// #cgo !wayland openbsd CFLAGS: -D_GLFW_X11 -D_GLFW_HAS_GLXGETPROCADDRESSARB +// #cgo wayland,!openbsd CFLAGS: -D_GLFW_WAYLAND +// #cgo LDFLAGS: -lm +import "C" diff --git a/internal/cglfw/build_darwin.go b/internal/cglfw/build_darwin.go new file mode 100644 index 000000000..d70d38842 --- /dev/null +++ b/internal/cglfw/build_darwin.go @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: BSD-3-Clause +// SPDX-FileCopyrightText: 2012 The glfw3-go Authors +// SPDX-FileCopyrightText: 2023 The Ebitengine Authors + +package cglfw + +// #cgo CFLAGS: -D_GLFW_COCOA -Wno-deprecated-declarations +// #cgo LDFLAGS: -framework Cocoa -framework IOKit -framework CoreVideo +import "C" diff --git a/internal/cglfw/build_linux.go b/internal/cglfw/build_linux.go new file mode 100644 index 000000000..651dff50d --- /dev/null +++ b/internal/cglfw/build_linux.go @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: BSD-3-Clause +// SPDX-FileCopyrightText: 2012 The glfw3-go Authors +// SPDX-FileCopyrightText: 2023 The Ebitengine Authors + +package cglfw + +// #cgo !wayland CFLAGS: -D_GLFW_X11 +// #cgo wayland CFLAGS: -D_GLFW_WAYLAND +// #cgo !wayland LDFLAGS: -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -lm -lXinerama -ldl -lrt +// #cgo wayland LDFLAGS: -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon -lm -ldl -lrt +import "C"