Skip to content

Commit 20004cb

Browse files
committed
cmake: Allow ENABLE_OPENGL option to be overridden on Linux aarch64
This option was originally disabled due to some devices not supporting OpenGL, however it was implemented by hardcoding the option to be set to OFF via CMAKE_DEPENDENT_OPTION. This change now allows the user to manually set ENABLE_OPENGL to ON in the CMake options, which was previously not possible.
1 parent d82be7a commit 20004cb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

CMakeLists.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ else()
6161
set(DEFAULT_ENABLE_LTO OFF)
6262
endif()
6363

64+
# Disable OpenGL by default on Linux aarch64.
65+
# Some aarch64 devices running Linux don't support OpenGL, and users may encounter issues.
66+
if (LINUX AND CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
67+
set(DEFAULT_ENABLE_OPENGL OFF)
68+
else()
69+
set(DEFAULT_ENABLE_OPENGL ON)
70+
endif()
71+
6472
option(ENABLE_SDL2 "Enable using SDL2" ON)
6573
CMAKE_DEPENDENT_OPTION(ENABLE_SDL2_FRONTEND "Enable the SDL2 frontend" OFF "ENABLE_SDL2;NOT ANDROID AND NOT IOS" OFF)
6674
option(USE_SYSTEM_SDL2 "Use the system SDL2 lib (instead of the bundled one)" OFF)
@@ -82,7 +90,7 @@ option(ENABLE_OPENAL "Enables the OpenAL audio backend" ON)
8290
CMAKE_DEPENDENT_OPTION(ENABLE_LIBUSB "Enable libusb for GameCube Adapter support" ON "NOT IOS" OFF)
8391

8492
CMAKE_DEPENDENT_OPTION(ENABLE_SOFTWARE_RENDERER "Enables the software renderer" ON "NOT ANDROID" OFF)
85-
CMAKE_DEPENDENT_OPTION(ENABLE_OPENGL "Enables the OpenGL renderer" ON "NOT APPLE AND NOT (LINUX AND CMAKE_SYSTEM_PROCESSOR STREQUAL \"aarch64\")" OFF)
93+
CMAKE_DEPENDENT_OPTION(ENABLE_OPENGL "Enables the OpenGL renderer" ${DEFAULT_ENABLE_OPENGL} "NOT APPLE" OFF)
8694
option(ENABLE_VULKAN "Enables the Vulkan renderer" ON)
8795

8896
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)

0 commit comments

Comments
 (0)