1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Make SDL2 default on macOS (#16039)

This commit is contained in:
sfence 2025-05-02 21:28:13 +02:00 committed by GitHub
parent d795c28af8
commit 0bdd5f294e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 22 additions and 14 deletions

View file

@ -1,11 +1,9 @@
# When enabling SDL2 by default on macOS, don't forget to change
# "NSHighResolutionCapable" to true in "Info.plist".
if(NOT APPLE)
set(DEFAULT_SDL2 ON)
endif()
set(DEFAULT_SDL2 ON)
option(USE_SDL2 "Use the SDL2 backend" ${DEFAULT_SDL2})
option(USE_SDL2_STATIC "Link with SDL2 static libraries" FALSE)
# Compiler flags
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
@ -228,7 +226,11 @@ endif()
if(ENABLE_OPENGL)
find_package(OpenGL REQUIRED)
endif()
set(USE_SDL2_SHARED FALSE)
if(USE_SDL2)
if(NOT USE_SDL2_STATIC)
set(USE_SDL2_SHARED TRUE)
endif()
if(NOT ANDROID)
find_package(SDL2 REQUIRED)
else()
@ -364,14 +366,14 @@ endif()
if(ENABLE_OPENGL3)
set(IRRDRVROBJ
${IRRDRVROBJ}
OpenGL3/Driver.cpp
OpenGL3/DriverGL3.cpp
)
endif()
if(ENABLE_GLES2)
set(IRRDRVROBJ
${IRRDRVROBJ}
OpenGLES2/Driver.cpp
OpenGLES2/DriverGLES2.cpp
)
endif()
@ -505,7 +507,8 @@ target_link_libraries(IrrlichtMt PRIVATE
${ZLIB_LIBRARY}
${JPEG_LIBRARY}
${PNG_LIBRARY}
"$<$<BOOL:${USE_SDL2}>:SDL2::SDL2>"
"$<$<BOOL:${USE_SDL2_SHARED}>:SDL2::SDL2>"
"$<$<BOOL:${USE_SDL2_STATIC}>:SDL2::SDL2-static>"
"$<$<BOOL:${OPENGL_DIRECT_LINK}>:${OPENGL_LIBRARIES}>"
${EGL_LIBRARY}

View file

@ -2,7 +2,7 @@
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in Irrlicht.h
#include "Driver.h"
#include "DriverGL3.h"
#include <cassert>
#include <stdexcept>
#include "mt_opengl.h"

View file

@ -2,7 +2,7 @@
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in Irrlicht.h
#include "Driver.h"
#include "DriverGLES2.h"
#include <stdexcept>
#include <cassert>
#include "mt_opengl.h"