Update CIrrDeviceSDL to support SDL2 (#85)

This commit is contained in:
Emmanuel Hansen
2022-01-16 11:16:15 +00:00
committed by GitHub
parent 195759100f
commit 53db262bd2
7 changed files with 207 additions and 263 deletions

View File

@ -56,6 +56,7 @@ unset(OGLES1_ENABLED CACHE)
unset(OGLES2_ENABLED CACHE)
unset(OGL_ENABLED CACHE)
unset(XINPUT2_ENABLED CACHE)
unset(SDL_ENABLED CACHE)
check_symbol_exists(_IRR_COMPILE_WITH_OGLES1_ "IrrCompileConfig.h" OGLES1_ENABLED)
if(OGLES1_ENABLED)
@ -79,6 +80,12 @@ if(XINPUT2_ENABLED)
find_library(XINPUT_LIBRARY Xi REQUIRED)
endif()
check_symbol_exists(_IRR_COMPILE_WITH_SDL_DEVICE_ "IrrCompileConfig.h" SDL_ENABLED)
if(SDL_ENABLED)
find_package(SDL2 CONFIG REQUIRED)
message(STATUS "Found SDL2: ${SDL2_LIBRARIES}")
endif()
# Platform-specific libs
if(ANDROID)
@ -101,6 +108,7 @@ set(link_includes
"${ZLIB_INCLUDE_DIR}"
"${JPEG_INCLUDE_DIR}"
"${PNG_INCLUDE_DIR}"
"${SDL2_INCLUDE_DIRS}"
${OPENGL_INCLUDE_DIR}
${OPENGLES2_INCLUDE_DIR}
@ -114,6 +122,7 @@ set(link_libs
"${ZLIB_LIBRARY}"
"${JPEG_LIBRARY}"
"${PNG_LIBRARY}"
"${SDL2_LIBRARIES}"
${OPENGL_LIBRARIES}
${OPENGLES_LIBRARY}