Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a78c7ef
external_deps: use -O3 and -fPIC for all packages
illwieckz Nov 10, 2024
9159e5a
external_deps: bump lib versions
illwieckz Nov 11, 2024
b47d2af
external_deps: fix SDL2 windows build
illwieckz Nov 18, 2024
4e4f48c
external_deps: introduce “cmake_build” and “configure_build” wrappers…
illwieckz Nov 10, 2024
a49f67c
cmake: copy all macOS frameworks from deps
illwieckz Nov 18, 2024
a569b64
cmake,external_deps: install and look for macos frameworks in lib/
illwieckz Nov 18, 2024
00180db
external_deps: add the missing “ncurses” to “all” linux dependencies
illwieckz Jul 19, 2025
8266723
external_deps: fix JPEG and OpenAL download
illwieckz Nov 11, 2024
7cafe3b
external_deps: bump OpenAL since we're now building on Bookworm with …
illwieckz Aug 13, 2025
d058a1a
external_deps: fix DMG mounting on macOS, the build folder may not be…
illwieckz Aug 13, 2025
7d107bd
external_deps: the NaCl runtime is only buildable on linux-amd64
illwieckz Jul 19, 2025
8df7e84
external_deps: do not install Linux shared libs
illwieckz Aug 14, 2025
3e7c8ce
external_deps: set forced and optional Opus intrinsics
illwieckz Aug 14, 2025
3719c80
external_deps: set forced and optional OpenAL intrinsics
illwieckz Aug 14, 2025
cce14df
external_deps: rework the OpenAL build
illwieckz Aug 14, 2025
680eeac
external_deps: set forced JPEG intrinsics
illwieckz Aug 14, 2025
470fef4
external_deps: set optional WebP intrinsics
illwieckz Aug 14, 2025
630eee7
external_deps: disable WebP threads
illwieckz Aug 14, 2025
0790cca
external_deps: avoid libwinpthread dependency on JPEG dll
slipher Apr 22, 2025
c5214f9
Switch to SDL3, bump deps version
VReaperV Aug 13, 2025
343b683
external_deps: strip static libraries (required for stripping Nettle …
illwieckz Aug 15, 2025
dd7304a
external_deps: bump macOS requirement to 10.14 because of OpenAL
illwieckz Aug 15, 2025
5b82746
external_deps: disable Nettle fat, fix build on newer Debian
illwieckz Aug 14, 2025
7dbfd80
sdl3: disable the "accent menu" on macOS
slipher Aug 15, 2025
ac2dbd8
external_deps: do not install _g symbol libraries (required for clean…
illwieckz Aug 15, 2025
b9810e6
sdl3: fix r_displayIndex on Linux
slipher Aug 15, 2025
f0cf87f
external_deps: use the same STRIP everytime we need to strip something
illwieckz Aug 15, 2025
1665cd6
external_deps: refactor the GLEW build
illwieckz Aug 15, 2025
272fe0a
external_deps: check for absolute paths in result
slipher Aug 15, 2025
8391bd6
cmake: don't set CMAKE_FIND_ROOT_PATH in toolchain files
slipher Aug 16, 2025
f31e415
cmake: download test deps archive from test/deps if not released yet
illwieckz Nov 16, 2024
c629b5e
external_deps: disable SDL3 deps on unwanted audio libs
slipher Aug 16, 2025
ff61bd8
external_deps: remove the SDL workaround for missing bin/ folder
illwieckz Sep 1, 2025
2c4c5b2
external_deps: make pkg-config working when cross-compiling
illwieckz Sep 3, 2025
0c831a2
external_deps: disable -fpic when building nettle, we already use -fPIC
illwieckz Sep 3, 2025
7bde7ce
dl_main: CURL_STATICLIB is now injected by CURLTargets.cmake
slipher Aug 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
run: |
set -x
sudo apt-get update
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
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
git submodule update --init --recursive

curl -sS https://gitlab.com/illwieckz/git-checkout-modules/raw/master/git-checkout-modules -o ~/git-checkout-modules
Expand Down
89 changes: 46 additions & 43 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ else()
endif()

# Dependencies version, this must match the number in external_deps/build.sh
set(DEPS_VERSION 10)
set(DEPS_VERSION 11)

option(USE_EXTERNAL_DEPS "Download or reuse dependencies from EXTERNAL_DEPS_DIR (mandatory for building and running NaCl .nexe binaries)." ON)

Expand Down Expand Up @@ -454,22 +454,38 @@ if (DEPS_DIR)
if (NOT EXISTS ${DEPS_DIR})
file(MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR})
get_filename_component(BASENAME ${DEPS_DIR} NAME)
set(REMOTE "https://dl.unvanquished.net/deps/${BASENAME}${DEPS_EXT}")
message(STATUS "Downloading dependencies from '${REMOTE}'")
file(DOWNLOAD ${REMOTE} ${OBJ_DIR}/${BASENAME}${DEPS_EXT}
SHOW_PROGRESS
STATUS DOWNLOAD_RESULT
LOG DOWNLOAD_LOG
)
list(GET DOWNLOAD_RESULT 0 DOWNLOAD_STATUS)
list(GET DOWNLOAD_RESULT 1 DOWNLOAD_STRING)
set(DEPS_FILENAME "${BASENAME}${DEPS_EXT}")

# Download test DEPS archive if DEPS archive isn't available yet.
# This makes possible to get the CI working before releasing the DEPS archive.
foreach(REMOTE_BASEURL https://dl.unvanquished.net/deps;https://dl.unvanquished.net/test/deps)
set(REMOTE "${REMOTE_BASEURL}/${DEPS_FILENAME}")
message(STATUS "Downloading dependencies from '${REMOTE}'")

file(DOWNLOAD "${REMOTE}" "${OBJ_DIR}/${DEPS_FILENAME}"
SHOW_PROGRESS
STATUS DOWNLOAD_RESULT
LOG DOWNLOAD_LOG
)

list(GET DOWNLOAD_RESULT 0 DOWNLOAD_STATUS)
list(GET DOWNLOAD_RESULT 1 DOWNLOAD_STRING)

if (DOWNLOAD_STATUS EQUAL 0)
break()
else ()
message(WARNING "Error downloading '${REMOTE}':
Status code: ${DOWNLOAD_STATUS}
Error string: ${DOWNLOAD_STRING}
Download log: ${DOWNLOAD_LOG}"
)
endif()
endforeach()

if (NOT DOWNLOAD_STATUS EQUAL 0)
message(FATAL_ERROR "Error downloading '${REMOTE}':
Status code: ${DOWNLOAD_STATUS}
Error string: ${DOWNLOAD_STRING}
Download log: ${DOWNLOAD_LOG}"
)
message(FATAL_ERROR "Failed to download '${DEPS_FILENAME}'")
endif()

message(STATUS "Download completed successfully")

# Extract the downloaded archive
Expand All @@ -486,7 +502,7 @@ if (DEPS_DIR)
# Add to paths
set(CMAKE_FIND_ROOT_PATH ${DEPS_DIR} ${CMAKE_FIND_ROOT_PATH})
set(CMAKE_INCLUDE_PATH ${DEPS_DIR} ${DEPS_DIR}/include ${CMAKE_INCLUDE_PATH})
set(CMAKE_FRAMEWORK_PATH ${DEPS_DIR} ${CMAKE_FRAMEWORK_PATH})
set(CMAKE_FRAMEWORK_PATH ${DEPS_DIR}/lib ${CMAKE_FRAMEWORK_PATH})
set(CMAKE_PREFIX_PATH ${DEPS_DIR} ${CMAKE_PREFIX_PATH})
if (DAEMON_PARENT_SCOPE_DIR)
# Also set parent scope so the top level CMakeLists can find precompiled deps
Expand Down Expand Up @@ -709,30 +725,12 @@ endif()

# SDL, required for all targets on win32 because of iconv and SDL_SetHint(SDL_TIMER_RESOLUTION, 0)
if (BUILD_CLIENT OR WIN32)
find_package(SDL2 CONFIG)

if (SDL2_SDL2main_FOUND)
mark_as_advanced(SDL2_DIR)
else()
# We cannot use REQUIRED because it would look
# for OldSDL2_FOUND instead of SDL2_FOUND.
find_package(OldSDL2)

if (NOT SDL2_FOUND)
message(FATAL_ERROR "Could NOT find SDL2")
endif()

include_directories(${SDL2_INCLUDE_DIR})

mark_as_advanced(SDL2MAIN_LIBRARY SDL2_LIBRARY SDL2_INCLUDE_DIR)
endif ()
find_package(SDL3 REQUIRED CONFIG)

if (WIN32)
set(LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE}
$<$<TARGET_EXISTS:SDL2::SDL2main>:SDL2::SDL2main> SDL2::SDL2)
set(LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE} SDL3::SDL3)
else()
set(LIBS_CLIENT ${LIBS_CLIENT}
$<$<TARGET_EXISTS:SDL2::SDL2main>:SDL2::SDL2main> SDL2::SDL2)
set(LIBS_CLIENT ${LIBS_CLIENT} SDL3::SDL3)
endif()
endif()

Expand Down Expand Up @@ -1062,11 +1060,16 @@ if (DEPS_DIR AND (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMM

# Mac requires some libraries from external_deps
if (APPLE)
add_custom_command(TARGET runtime_deps PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${DEPS_DIR}/SDL2.framework
${FULL_OUTPUT_DIR}/SDL2.framework
)
file(GLOB RUNTIME_FRAMEWORKS ${DEPS_DIR}/lib/*.framework)
foreach(RUNTIME_FRAMEWORK ${RUNTIME_FRAMEWORKS})
get_filename_component(RUNTIME_FRAMEWORK_NAME ${RUNTIME_FRAMEWORK} NAME)
add_custom_command(TARGET runtime_deps PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${RUNTIME_FRAMEWORK}
${FULL_OUTPUT_DIR}/${RUNTIME_FRAMEWORK_NAME}
)
endforeach()

file(GLOB RUNTIME_LIBS ${DEPS_DIR}/lib/*.dylib)
foreach(RUNTIME_LIB ${RUNTIME_LIBS})
add_custom_command(TARGET runtime_deps PRE_BUILD
Expand All @@ -1079,7 +1082,7 @@ if (DEPS_DIR AND (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMM

# Windows requires some libraries from external_deps
if (WIN32)
file(GLOB RUNTIME_LIBS ${DEPS_DIR}/bin/*.dll ${DEPS_DIR}/SDL2/lib/*/SDL2.dll)
file(GLOB RUNTIME_LIBS ${DEPS_DIR}/bin/*.dll ${DEPS_DIR}/SDL3/lib/*/SDL3.dll)
foreach(RUNTIME_LIB ${RUNTIME_LIBS})
add_custom_command(TARGET runtime_deps PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- bash: |
set -e
sudo apt-get update
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)
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)
$(EXTRA_INSTALLS)
displayName: 'Install deps'
- bash: |
Expand Down
186 changes: 0 additions & 186 deletions cmake/FindOldSDL2.cmake

This file was deleted.

4 changes: 1 addition & 3 deletions cmake/cross-toolchain-mingw32.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ set( CMAKE_C_COMPILER i686-w64-mingw32-gcc )
set( CMAKE_CXX_COMPILER i686-w64-mingw32-g++ )
set( CMAKE_RC_COMPILER i686-w64-mingw32-windres )

# Target prefix
set( CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 )

# Find programs using host paths and headers/libraries using target paths
# FIXME: not respected when cmake invokes pkg-config
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
4 changes: 1 addition & 3 deletions cmake/cross-toolchain-mingw64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ set( CMAKE_C_COMPILER x86_64-w64-mingw32-gcc )
set( CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++ )
set( CMAKE_RC_COMPILER x86_64-w64-mingw32-windres )

# Target prefix
set( CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 )

# Find programs using host paths and headers/libraries using target paths
# FIXME: not respected when cmake invokes pkg-config
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
Loading