Skip to content

Commit d55fd59

Browse files
committed
Merge branch 'master' into for-0.56.0/sync
2 parents 6c3672b + 5e536bc commit d55fd59

File tree

16 files changed

+840
-665
lines changed

16 files changed

+840
-665
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
run: |
7474
set -x
7575
sudo apt-get update
76-
sudo apt-get -y -q --no-install-recommends install zlib1g-dev libncursesw5-dev libgeoip-dev nettle-dev libgmp-dev libcurl4-gnutls-dev libsdl2-dev libogg-dev libvorbis-dev libopusfile-dev libwebp-dev libjpeg8-dev libpng-dev libfreetype6-dev libglew-dev libopenal-dev ninja-build
76+
sudo apt-get -y -q --no-install-recommends install zlib1g-dev libncursesw5-dev libgeoip-dev nettle-dev libgmp-dev libcurl4-gnutls-dev libogg-dev libvorbis-dev libopusfile-dev libwebp-dev libjpeg8-dev libpng-dev libfreetype6-dev libglew-dev libopenal-dev ninja-build
7777
git submodule update --init --recursive
7878
7979
curl -sS https://gitlab.com/illwieckz/git-checkout-modules/raw/master/git-checkout-modules -o ~/git-checkout-modules

CMakeLists.txt

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ else()
214214
endif()
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

219219
option(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)
711727
if (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()
737735
endif()
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

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
- bash: |
121121
set -e
122122
sudo apt-get update
123-
sudo apt-get -y -q --no-install-recommends install zlib1g-dev libncursesw5-dev libgeoip-dev nettle-dev libgmp-dev libcurl4-gnutls-dev libsdl2-dev libogg-dev libvorbis-dev libopusfile-dev libwebp-dev libjpeg8-dev libpng-dev libfreetype6-dev libglew-dev libopenal-dev liblua5.2-dev ninja-build $(EXTRA_PACKAGES)
123+
sudo apt-get -y -q --no-install-recommends install zlib1g-dev libncursesw5-dev libgeoip-dev nettle-dev libgmp-dev libcurl4-gnutls-dev libogg-dev libvorbis-dev libopusfile-dev libwebp-dev libjpeg8-dev libpng-dev libfreetype6-dev libglew-dev libopenal-dev liblua5.2-dev ninja-build $(EXTRA_PACKAGES)
124124
$(EXTRA_INSTALLS)
125125
displayName: 'Install deps'
126126
- bash: |

cmake/FindOldSDL2.cmake

Lines changed: 0 additions & 186 deletions
This file was deleted.

cmake/cross-toolchain-mingw32.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ set( CMAKE_C_COMPILER i686-w64-mingw32-gcc )
77
set( CMAKE_CXX_COMPILER i686-w64-mingw32-g++ )
88
set( CMAKE_RC_COMPILER i686-w64-mingw32-windres )
99

10-
# Target prefix
11-
set( CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 )
12-
1310
# Find programs using host paths and headers/libraries using target paths
11+
# FIXME: not respected when cmake invokes pkg-config
1412
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
1513
set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
1614
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )

cmake/cross-toolchain-mingw64.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ set( CMAKE_C_COMPILER x86_64-w64-mingw32-gcc )
77
set( CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++ )
88
set( CMAKE_RC_COMPILER x86_64-w64-mingw32-windres )
99

10-
# Target prefix
11-
set( CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 )
12-
1310
# Find programs using host paths and headers/libraries using target paths
11+
# FIXME: not respected when cmake invokes pkg-config
1412
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
1513
set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
1614
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )

0 commit comments

Comments
 (0)