Skip to content

Commit 127cc1c

Browse files
committed
REVIEWED: Makefile to support software renderer
1 parent 3389c80 commit 127cc1c

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

examples/Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,19 @@ endif
486486
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
487487
# Libraries for DRM compiling
488488
# NOTE: Required packages: libasound2-dev (ALSA)
489-
LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic
489+
LDLIBS = -lraylib -lGLESv2 -lEGL -ldrm -lgbm -lpthread -lrt -lm -ldl -latomic
490+
# TODO: Examples compilation does not define GRAPHICS, is it required?
491+
#ifeq ($(GRAPHICS),GRAPHICS_API_OPENGL_ES2)
492+
# LDLIBS += -lGLESv2 -lEGL
493+
#endif
494+
endif
495+
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
496+
# Libraries for Windows desktop compilation
497+
LDFLAGS += -L..\src
498+
LDLIBS = -lraylib -lgdi32 -lwinmm -lshcore
499+
ifneq ($(GRAPHICS),GRAPHICS_API_OPENGL_11_SOFTWARE)
500+
LDLIBS += -lopengl32
501+
endif
490502
endif
491503
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
492504
# Libraries for web (HTML5) compiling

src/Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
228228
ifeq ($(ANDROID_ARCH),x86_64)
229229
ANDROID_COMPILER_ARCH = x86_64
230230
endif
231-
232231
endif
233232

234233
# Define raylib graphics api depending on selected platform
@@ -261,8 +260,8 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
261260
#GRAPHICS = GRAPHICS_API_OPENGL_ES2 # Uncomment to use OpenGL ES 2.0 (ANGLE)
262261
endif
263262
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
264-
# On DRM OpenGL ES 2.0 must be used
265263
GRAPHICS ?= GRAPHICS_API_OPENGL_ES2
264+
#GRAPHICS = GRAPHICS_API_OPENGL_11_SOFTWARE # Uncomment to use software rendering
266265
endif
267266
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
268267
# On HTML5 OpenGL ES 2.0 is used, emscripten translates it to WebGL 1.0
@@ -636,13 +635,19 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW)
636635
endif
637636
endif
638637
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
639-
LDLIBS = -lGLESv2 -lEGL -ldrm -lgbm -lpthread -lrt -lm -ldl
638+
LDLIBS = -ldrm -lgbm -lpthread -lrt -lm -ldl
639+
ifeq ($(GRAPHICS),GRAPHICS_API_OPENGL_ES2)
640+
LDLIBS += -lGLESv2 -lEGL
641+
endif
640642
ifeq ($(RAYLIB_MODULE_AUDIO),TRUE)
641643
LDLIBS += -latomic
642644
endif
643645
endif
644646
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
645-
LDLIBS = -lgdi32 -lwinmm -lopengl32 -lshcore
647+
LDLIBS = -lgdi32 -lwinmm -lshcore
648+
ifneq ($(GRAPHICS),GRAPHICS_API_OPENGL_11_SOFTWARE)
649+
LDLIBS += -lopengl32
650+
endif
646651
endif
647652
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
648653
LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm

0 commit comments

Comments
 (0)