@@ -214,7 +214,7 @@ else()
214214endif ()
215215
216216# Dependencies version, this must match the number in external_deps/build.sh
217- set (DEPS_VERSION 10 )
217+ set (DEPS_VERSION 11 )
218218
219219option (USE_EXTERNAL_DEPS "Download or reuse dependencies from EXTERNAL_DEPS_DIR (mandatory for building and running NaCl .nexe binaries)." ON )
220220
@@ -454,22 +454,38 @@ if (DEPS_DIR)
454454 if (NOT EXISTS ${DEPS_DIR} )
455455 file (MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR} )
456456 get_filename_component (BASENAME ${DEPS_DIR} NAME )
457- set (REMOTE "https://dl.unvanquished.net/deps/${BASENAME}${DEPS_EXT} " )
458- message (STATUS "Downloading dependencies from '${REMOTE} '" )
459- file (DOWNLOAD ${REMOTE} ${OBJ_DIR} /${BASENAME}${DEPS_EXT}
460- SHOW_PROGRESS
461- STATUS DOWNLOAD_RESULT
462- LOG DOWNLOAD_LOG
463- )
464- list (GET DOWNLOAD_RESULT 0 DOWNLOAD_STATUS)
465- list (GET DOWNLOAD_RESULT 1 DOWNLOAD_STRING)
457+ set (DEPS_FILENAME "${BASENAME}${DEPS_EXT} " )
458+
459+ # Download test DEPS archive if DEPS archive isn't available yet.
460+ # This makes possible to get the CI working before releasing the DEPS archive.
461+ foreach (REMOTE_BASEURL https://dl.unvanquished.net/deps;https://dl.unvanquished.net/test /deps)
462+ set (REMOTE "${REMOTE_BASEURL} /${DEPS_FILENAME} " )
463+ message (STATUS "Downloading dependencies from '${REMOTE} '" )
464+
465+ file (DOWNLOAD "${REMOTE} " "${OBJ_DIR} /${DEPS_FILENAME} "
466+ SHOW_PROGRESS
467+ STATUS DOWNLOAD_RESULT
468+ LOG DOWNLOAD_LOG
469+ )
470+
471+ list (GET DOWNLOAD_RESULT 0 DOWNLOAD_STATUS)
472+ list (GET DOWNLOAD_RESULT 1 DOWNLOAD_STRING)
473+
474+ if (DOWNLOAD_STATUS EQUAL 0)
475+ break ()
476+ else ()
477+ message (WARNING "Error downloading '${REMOTE} ':
478+ Status code: ${DOWNLOAD_STATUS}
479+ Error string: ${DOWNLOAD_STRING}
480+ Download log: ${DOWNLOAD_LOG} "
481+ )
482+ endif ()
483+ endforeach ()
484+
466485 if (NOT DOWNLOAD_STATUS EQUAL 0)
467- message (FATAL_ERROR "Error downloading '${REMOTE} ':
468- Status code: ${DOWNLOAD_STATUS}
469- Error string: ${DOWNLOAD_STRING}
470- Download log: ${DOWNLOAD_LOG} "
471- )
486+ message (FATAL_ERROR "Failed to download '${DEPS_FILENAME} '" )
472487 endif ()
488+
473489 message (STATUS "Download completed successfully" )
474490
475491 # Extract the downloaded archive
@@ -486,7 +502,7 @@ if (DEPS_DIR)
486502 # Add to paths
487503 set (CMAKE_FIND_ROOT_PATH ${DEPS_DIR} ${CMAKE_FIND_ROOT_PATH} )
488504 set (CMAKE_INCLUDE_PATH ${DEPS_DIR} ${DEPS_DIR} /include ${CMAKE_INCLUDE_PATH} )
489- set (CMAKE_FRAMEWORK_PATH ${DEPS_DIR} ${CMAKE_FRAMEWORK_PATH} )
505+ set (CMAKE_FRAMEWORK_PATH ${DEPS_DIR} /lib ${CMAKE_FRAMEWORK_PATH} )
490506 set (CMAKE_PREFIX_PATH ${DEPS_DIR} ${CMAKE_PREFIX_PATH} )
491507 if (DAEMON_PARENT_SCOPE_DIR)
492508 # Also set parent scope so the top level CMakeLists can find precompiled deps
@@ -709,30 +725,12 @@ endif()
709725
710726# SDL, required for all targets on win32 because of iconv and SDL_SetHint(SDL_TIMER_RESOLUTION, 0)
711727if (BUILD_CLIENT OR WIN32 )
712- find_package (SDL2 CONFIG)
713-
714- if (SDL2_SDL2main_FOUND)
715- mark_as_advanced (SDL2_DIR)
716- else ()
717- # We cannot use REQUIRED because it would look
718- # for OldSDL2_FOUND instead of SDL2_FOUND.
719- find_package (OldSDL2)
720-
721- if (NOT SDL2_FOUND)
722- message (FATAL_ERROR "Could NOT find SDL2" )
723- endif ()
724-
725- include_directories (${SDL2_INCLUDE_DIR} )
726-
727- mark_as_advanced (SDL2MAIN_LIBRARY SDL2_LIBRARY SDL2_INCLUDE_DIR)
728- endif ()
728+ find_package (SDL3 REQUIRED CONFIG)
729729
730730 if (WIN32 )
731- set (LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE}
732- $<$<TARGET_EXISTS:SDL2::SDL2main>:SDL2::SDL2main> SDL2::SDL2)
731+ set (LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE} SDL3::SDL3)
733732 else ()
734- set (LIBS_CLIENT ${LIBS_CLIENT}
735- $<$<TARGET_EXISTS:SDL2::SDL2main>:SDL2::SDL2main> SDL2::SDL2)
733+ set (LIBS_CLIENT ${LIBS_CLIENT} SDL3::SDL3)
736734 endif ()
737735endif ()
738736
@@ -1062,11 +1060,16 @@ if (DEPS_DIR AND (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMM
10621060
10631061 # Mac requires some libraries from external_deps
10641062 if (APPLE )
1065- add_custom_command (TARGET runtime_deps PRE_BUILD
1066- COMMAND ${CMAKE_COMMAND} -E copy_directory
1067- ${DEPS_DIR} /SDL2.framework
1068- ${FULL_OUTPUT_DIR} /SDL2.framework
1069- )
1063+ file (GLOB RUNTIME_FRAMEWORKS ${DEPS_DIR} /lib/*.framework )
1064+ foreach (RUNTIME_FRAMEWORK ${RUNTIME_FRAMEWORKS} )
1065+ get_filename_component (RUNTIME_FRAMEWORK_NAME ${RUNTIME_FRAMEWORK} NAME )
1066+ add_custom_command (TARGET runtime_deps PRE_BUILD
1067+ COMMAND ${CMAKE_COMMAND} -E copy_directory
1068+ ${RUNTIME_FRAMEWORK}
1069+ ${FULL_OUTPUT_DIR} /${RUNTIME_FRAMEWORK_NAME}
1070+ )
1071+ endforeach ()
1072+
10701073 file (GLOB RUNTIME_LIBS ${DEPS_DIR} /lib/*.dylib)
10711074 foreach (RUNTIME_LIB ${RUNTIME_LIBS} )
10721075 add_custom_command (TARGET runtime_deps PRE_BUILD
@@ -1079,7 +1082,7 @@ if (DEPS_DIR AND (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMM
10791082
10801083 # Windows requires some libraries from external_deps
10811084 if (WIN32 )
1082- file (GLOB RUNTIME_LIBS ${DEPS_DIR} /bin/*.dll ${DEPS_DIR} /SDL2 /lib/*/SDL2 .dll)
1085+ file (GLOB RUNTIME_LIBS ${DEPS_DIR} /bin/*.dll ${DEPS_DIR} /SDL3 /lib/*/SDL3 .dll)
10831086 foreach (RUNTIME_LIB ${RUNTIME_LIBS} )
10841087 add_custom_command (TARGET runtime_deps PRE_BUILD
10851088 COMMAND ${CMAKE_COMMAND} -E copy_if_different
0 commit comments