@@ -208,6 +208,29 @@ endif()
208208# AsmJit
209209add_subdirectory (asmjit EXCLUDE_FROM_ALL )
210210
211+ # SDL3
212+ set (SDL3_TARGET 3rdparty_dummy_lib)
213+ if (USE_SDL)
214+ if (USE_SYSTEM_SDL)
215+ find_package (SDL3)
216+ if (SDL3_FOUND AND SDL3_VERSION VERSION_GREATER_EQUAL 3.2.0)
217+ message (STATUS "Using system SDL3 version '${SDL3_VERSION} '" )
218+ add_library (3rdparty_sdl3 INTERFACE )
219+ target_compile_definitions (3rdparty_sdl3 INTERFACE -DHAVE_SDL3=1)
220+ target_link_libraries (3rdparty_sdl3 INTERFACE SDL3::SDL3)
221+ set (SDL3_TARGET 3rdparty_sdl3)
222+ else ()
223+ message (FATAL_ERROR "SDL3 is not available on this system" )
224+ endif ()
225+ else ()
226+ message (STATUS "Using static SDL3 from 3rdparty" )
227+ add_subdirectory (libsdl-org EXCLUDE_FROM_ALL )
228+ target_compile_definitions (SDL3-static INTERFACE -DHAVE_SDL3=1)
229+ set (SDL3_TARGET SDL3-static )
230+ set (SDL3_DIR "${CMAKE_CURRENT_BINARY_DIR} /libsdl-org/SDL" CACHE STRING "" )
231+ endif ()
232+ endif ()
233+
211234# OpenAL
212235if (NOT ANDROID)
213236 add_subdirectory (OpenAL EXCLUDE_FROM_ALL )
@@ -222,31 +245,31 @@ if(USE_FAUDIO)
222245 # FAudio depends on SDL3
223246 find_package (SDL3)
224247 if (USE_SYSTEM_FAUDIO)
225- if (NOT SDL3_FOUND OR SDL3_VERSION VERSION_LESS 3.2.0)
226- message (WARNING
227- "RPCS3: System FAudio requires SDL 3.2.0 or newer. Since a valid SDL3"
228- ">=3.2.0 version cannot be found, building with FAudio will be skipped." )
229- set (USE_FAUDIO OFF CACHE BOOL "Disabled using system FAudio with SDL < 3.2.0" FORCE)
230- else ()
248+ if (SDL3_FOUND AND SDL3_VERSION VERSION_GREATER_EQUAL 3.2.0)
231249 message (STATUS "RPCS3: Using system FAudio" )
232250 find_package (FAudio REQUIRED CONFIGS FAudioConfig.cmake FAudio-config.cmake)
233251 add_library (3rdparty_FAudio INTERFACE )
234252 target_link_libraries (3rdparty_FAudio INTERFACE FAudio)
235253 target_compile_definitions (3rdparty_FAudio INTERFACE -DHAVE_FAUDIO)
236254 set (FAUDIO_TARGET 3rdparty_FAudio)
237- endif ()
238- else ()
239- if (NOT SDL3_FOUND OR SDL3_VERSION VERSION_LESS 3.2.0)
255+ else ()
240256 message (WARNING
241- "-- RPCS3: 3rdparty FAudio requires SDL 3.2.0 or newer. Since a valid SDL3"
257+ "RPCS3: System FAudio requires SDL 3.2.0 or newer. Since a valid SDL3"
242258 ">=3.2.0 version cannot be found, building with FAudio will be skipped." )
243- set (USE_FAUDIO OFF CACHE BOOL "Disabled FAudio with SDL < 3.2.0" FORCE)
244- else ()
259+ set (USE_FAUDIO OFF CACHE BOOL "Disabled using system FAudio with SDL < 3.2.0" FORCE)
260+ endif ()
261+ else ()
262+ if (SDL3_FOUND AND SDL3_VERSION VERSION_GREATER_EQUAL 3.2.0)
245263 message (STATUS "RPCS3: Using builtin FAudio" )
246264 set (BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared library" )
247265 add_subdirectory (FAudio EXCLUDE_FROM_ALL )
248266 target_compile_definitions (FAudio-static INTERFACE -DHAVE_FAUDIO)
249267 set (FAUDIO_TARGET FAudio-static )
268+ else ()
269+ message (FATAL_ERROR
270+ "-- RPCS3: 3rdparty FAudio requires SDL 3.2.0 or newer. Since a valid SDL3"
271+ ">=3.2.0 version cannot be found, building with FAudio will be skipped." )
272+ set (USE_FAUDIO OFF CACHE BOOL "Disabled FAudio with SDL < 3.2.0" FORCE)
250273 endif ()
251274 endif ()
252275endif ()
@@ -315,29 +338,6 @@ add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
315338# CURL
316339add_subdirectory (curl EXCLUDE_FROM_ALL )
317340
318- # SDL3
319- set (SDL3_TARGET 3rdparty_dummy_lib)
320- if (USE_SDL)
321- if (USE_SYSTEM_SDL)
322- find_package (SDL3)
323- if (SDL3_FOUND AND NOT SDL3_VERSION VERSION_LESS 3.2.0)
324- message (STATUS "Using system SDL3 version '${SDL3_VERSION} '" )
325- add_library (3rdparty_sdl3 INTERFACE )
326- target_compile_definitions (3rdparty_sdl3 INTERFACE -DHAVE_SDL3=1)
327- target_link_libraries (3rdparty_sdl3 INTERFACE SDL3::SDL3)
328- set (SDL3_TARGET 3rdparty_sdl3)
329- else ()
330- message (FATAL_ERROR "SDL3 is not available on this system" )
331- endif ()
332- else ()
333- message (STATUS "Using static SDL3 from 3rdparty" )
334- add_library (3rdparty_sdl3 INTERFACE )
335- target_compile_definitions (3rdparty_sdl3 INTERFACE -DHAVE_SDL3=1)
336- add_subdirectory (libsdl-org EXCLUDE_FROM_ALL )
337- set (SDL3_TARGET 3rdparty_sdl3)
338- endif ()
339- endif ()
340-
341341# MINIUPNP
342342add_subdirectory (miniupnp EXCLUDE_FROM_ALL )
343343
0 commit comments