summaryrefslogtreecommitdiffhomepage
path: root/src/Makefile
diff options
context:
space:
mode:
authorAlexandre Almeida <[email protected]>2024-03-14 12:54:39 -0300
committerGitHub <[email protected]>2024-03-14 16:54:39 +0100
commit9a8d73e6c32514275a0ba53fe528bcb7c2693e27 (patch)
tree9563c5000626b6e487fbccf439c9b71e7125e8cc /src/Makefile
parent42db6badd0848109746d6186792cf6a60363d7b3 (diff)
downloadraylib-9a8d73e6c32514275a0ba53fe528bcb7c2693e27.tar.gz
raylib-9a8d73e6c32514275a0ba53fe528bcb7c2693e27.zip
Fix GLFW runtime platform detection (#3863)
* Fix GLFW runtime platform detection * Add libwayland-dev package to workflows * Add libxkbcommon-dev package to workflows * Add libwayland-bin package to codeql.yml * Add libwayland-client0 and libwayland-cursor0 packages to codeql.yml * Use libwayland-dev in codeql.yml * Add libxkbcommon-dev to codeql.yml * Remove libwayland-bin from linux.yml and linux_examples.yml (libwayland-dev includes it as a dependency) --------- Co-authored-by: Ray <[email protected]>
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Makefile b/src/Makefile
index 7b881431..7f5dd335 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -96,15 +96,15 @@ RAYLIB_MODULE_RAYGUI_PATH ?= $(RAYLIB_SRC_PATH)/../../raygui/src
# Use external GLFW library instead of rglfw module
USE_EXTERNAL_GLFW ?= FALSE
+# Enable support for both Wayland and X11 by default on Linux when using GLFW
+GLFW_LINUX_ENABLE_WAYLAND ?= TRUE
+GLFW_LINUX_ENABLE_X11 ?= TRUE
+
# PLATFORM_DESKTOP_SDL: It requires SDL library to be provided externally
# WARNING: Library is not included in raylib, it MUST be configured by users
SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
-# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
-# NOTE: This variable is only used for PLATFORM_OS: LINUX
-USE_WAYLAND_DISPLAY ?= FALSE
-
# Determine if the file has root access (only required to install raylib)
# "whoami" prints the name of the user that calls him (so, if it is the root user, "whoami" prints "root")
ROOT = $(shell whoami)
@@ -407,7 +407,11 @@ endif
# Use Wayland display on Linux desktop
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS), LINUX)
- ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
+ ifeq ($(GLFW_LINUX_ENABLE_X11),TRUE)
+ CFLAGS += -D_GLFW_X11
+ endif
+
+ ifeq ($(GLFW_LINUX_ENABLE_WAYLAND),TRUE)
CFLAGS += -D_GLFW_WAYLAND
LDFLAGS += $(shell pkg-config wayland-client wayland-cursor wayland-egl xkbcommon --libs)
@@ -533,7 +537,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
endif
ifeq ($(PLATFORM_OS),LINUX)
LDLIBS = -lGL -lc -lm -lpthread -ldl -lrt
- ifeq ($(USE_WAYLAND_DISPLAY),FALSE)
+ ifeq ($(GLFW_LINUX_ENABLE_X11),TRUE)
LDLIBS += -lX11
endif
# TODO: On ARM 32bit arch, miniaudio requires atomics library