merge changes to make vcpkg caches smaller

This commit is contained in:
Logan Aerl Arias 2025-03-10 01:39:35 +00:00 committed by Eidolon
parent e6eaaebd89
commit d0e1dfe526
22 changed files with 508 additions and 319 deletions

3
.gitattributes vendored
View file

@ -20,6 +20,9 @@
*.csproj* -crlf -whitespace
*.vcxproj* -crlf -whitespace
*.manifest -crlf -whitespace
# vcpkg
/vcpkg.json text=auto
/vcpkg-configuration.json text=auto
# Patches
/tools/SDL-1.2.14-gc/SDL-1.2.14-gc.patch -whitespace
#Appveyor

View file

@ -20,7 +20,7 @@ Alpine 3 GCC Dedicated:
- - |
# apk_development
echo -e "\e[0Ksection_start:`date +%s`:apk_development[collapsed=true]\r\e[0KInstalling development packages"
- apk add cmake musl-dev sdl2_mixer-dev libpng-dev curl-dev libgme-dev libopenmpt-dev miniupnpc-dev elfutils-dev
- apk add cmake musl-dev sdl2-dev libpng-dev curl-dev miniupnpc-dev elfutils-dev
- |
# apk_development
echo -e "\e[0Ksection_end:`date +%s`:apk_development\r\e[0K"
@ -28,7 +28,14 @@ Alpine 3 GCC Dedicated:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -DSRB2_CONFIG_DEDICATED=ON
- |
cmake \
--preset ninja-debug \
-B build.cmake \
-G "Unix Makefiles" \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF \
-DSRB2_CONFIG_EXECINFO=NO \
-DSRB2_CONFIG_DEDICATED=ON
- |
# cmake
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"

View file

@ -58,26 +58,24 @@ Alpine 3 GCC:
- - |
# ccache_config
echo -e "\e[0Ksection_start:`date +%s`:ccache_config[collapsed=true]\r\e[0KSetting up ccache config"
- mkdir --parents --verbose ~/.ccache/
- touch ~/.ccache/ccache.conf
- |
# cache.conf
echo Adding ccache configution option
- |
# base_dir
echo base_dir = $PWD | tee -a ~/.ccache/ccache.conf
ccache --set-config base_dir=$CI_PROJECT_DIR
- |
# cache_dir
echo cache_dir = $PWD/ccache | tee -a ~/.ccache/ccache.conf
ccache --set-config cache_dir=$CI_PROJECT_DIR/build/ccache
- |
# compiler_check
echo compiler_check = content | tee -a ~/.ccache/ccache.conf
ccache --set-config compiler_check=content
- |
# stats_log
echo stats_log = $PWD/ccache_statslog | tee -a ~/.ccache/ccache.conf
ccache --set-config stats_log=$CI_PROJECT_DIR/build/ccache_statslog
- |
# max_size
echo max_size = 50M | tee -a ~/.ccache/ccache.conf
ccache --set-config max_size=300M
- |
# ccache_config
echo -e "\e[0Ksection_end:`date +%s`:ccache_config\r\e[0K"
@ -103,7 +101,7 @@ Alpine 3 GCC:
- - |
# apk_development
echo -e "\e[0Ksection_start:`date +%s`:apk_development[collapsed=true]\r\e[0KInstalling development packages"
- apk add cmake musl-dev sdl2_mixer-dev libpng-dev curl-dev libgme-dev libopenmpt-dev miniupnpc-dev elfutils-dev
- apk add cmake musl-dev sdl2-dev libpng-dev curl-dev miniupnpc-dev elfutils-dev
- |
# apk_development
echo -e "\e[0Ksection_end:`date +%s`:apk_development\r\e[0K"
@ -111,7 +109,13 @@ Alpine 3 GCC:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
cmake \
--preset ninja-debug \
-B build.cmake \
-G "Unix Makefiles" \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF \
-DSRB2_CONFIG_EXECINFO=NO
- |
# cmake
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
@ -119,7 +123,7 @@ Alpine 3 GCC:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.cmake --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -1,6 +1,8 @@
batocera:arm64:
extends: Debian stable:arm64
stage: build
when: manual
allow_failure: true
@ -24,7 +26,7 @@ batocera:arm64:
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libopenmpt-dev:arm64 libminiupnpc-dev:arm64
- apt-get install libsdl2-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libyuv-dev:arm64 libminiupnpc-dev:arm64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
@ -32,7 +34,13 @@ batocera:arm64:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
cmake \
--preset ninja-debug \
-B build.cmake \
-G "Unix Makefiles" \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF \
-DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON
- |
# cmake
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
@ -40,7 +48,7 @@ batocera:arm64:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.cmake --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -1,6 +1,8 @@
Debian oldstable:amd64:
extends: Debian stable:amd64
stage: build
when: manual
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:oldstable
@ -26,7 +28,7 @@ Debian oldstable:amd64:
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:amd64 libpng-dev:amd64 libcurl4-openssl-dev:amd64 libopenmpt-dev:amd64 libminiupnpc-dev:amd64
- apt-get install libsdl2-dev:amd64 libpng-dev:amd64 libcurl4-openssl-dev:amd64 libminiupnpc-dev:amd64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
@ -34,7 +36,15 @@ Debian oldstable:amd64:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
cmake \
-B build.cmake \
-G "Unix Makefiles" \
-DCMAKE_C_FLAGS_RELWITHDEBINFO="-O3 -g -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O3 -g -DNDEBUG"
-DSRB2_CONFIG_DEV_BUILD=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
# cmake
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
@ -42,7 +52,7 @@ Debian oldstable:amd64:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.cmake --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -1,6 +1,8 @@
Debian oldstable:arm64:
extends: Debian stable:arm64
stage: build
when: manual
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:oldstable
@ -26,7 +28,7 @@ Debian oldstable:arm64:
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libopenmpt-dev:arm64 libminiupnpc-dev:arm64
- apt-get install libsdl2-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libminiupnpc-dev:arm64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
@ -34,7 +36,16 @@ Debian oldstable:arm64:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
cmake \
-B build.cmake \
-G "Unix Makefiles" \
-DCMAKE_C_FLAGS_RELWITHDEBINFO="-O3 -g -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O3 -g -DNDEBUG"
-DSRB2_CONFIG_DEV_BUILD=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF \
-DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON
- |
# cmake
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
@ -42,7 +53,7 @@ Debian oldstable:arm64:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.cmake --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -13,7 +13,6 @@ Debian stable:amd64:
variables:
CC: x86_64-linux-gnu-gcc
CXX: x86_64-linux-gnu-g++
LDFLAGS: -Wl,-fuse-ld=gold
OBJCOPY: x86_64-linux-gnu-objcopy
OBJDUMP: x86_64-linux-gnu-objdump
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig
@ -32,7 +31,7 @@ Debian stable:amd64:
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:amd64 libpng-dev:amd64 libcurl4-openssl-dev:amd64 libgme-dev:amd64 libopenmpt-dev:amd64 libminiupnpc-dev:amd64
- apt-get install libsdl2-dev:amd64 libpng-dev:amd64 libcurl4-openssl-dev:amd64 libyuv-dev:amd64 libminiupnpc-dev:amd64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
@ -41,10 +40,10 @@ Debian stable:amd64:
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- |
CCACHE=$(which ccache)
cmake -B build.cmake \
-DCMAKE_C_COMPILER_LAUNCHER=$CCACHE \
-DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE \
cmake \
--preset ninja-debug \
-B build.cmake \
-G "Unix Makefiles" \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
# cmake
@ -53,7 +52,7 @@ Debian stable:amd64:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.cmake --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -15,7 +15,6 @@ Debian stable:arm64:
variables:
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
LDFLAGS: -Wl,-fuse-ld=gold
OBJCOPY: aarch64-linux-gnu-objcopy
OBJDUMP: aarch64-linux-gnu-objdump
LD: aarch64-linux-gnu-ld
@ -33,7 +32,7 @@ Debian stable:arm64:
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libgme-dev:arm64 libopenmpt-dev:arm64 libminiupnpc-dev:arm64
- apt-get install libsdl2-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libyuv-dev:arm64 libminiupnpc-dev:arm64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
@ -41,7 +40,13 @@ Debian stable:arm64:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
cmake \
--preset ninja-debug \
-B build.cmake \
-G "Unix Makefiles" \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF \
-DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON
- |
# cmake
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
@ -49,7 +54,7 @@ Debian stable:arm64:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.cmake --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -3,9 +3,9 @@ Debian stable Clang:
stage: build
when: manual
when: on_success
allow_failure: true
allow_failure: false
artifacts:
paths:
@ -16,10 +16,9 @@ Debian stable Clang:
variables:
CC: clang
CXX: clang
WFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror
CFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror
LDFLAGS: -Wl,-fuse-ld=gold
CXX: clang++
WFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Wno-error=parentheses-equality -Wno-error=misleading-indentation -Wno-error=fortify-source -Werror
CFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Wno-error=parentheses-equality -Wno-error=misleading-indentation -Wno-error=fortify-source -Werror
script:
- - |
@ -33,7 +32,7 @@ Debian stable Clang:
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev libminiupnpc-dev
- apt-get install libsdl2-dev libpng-dev libcurl4-openssl-dev libyuv-dev libminiupnpc-dev
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
@ -41,7 +40,15 @@ Debian stable Clang:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
cmake \
--preset ninja-debug \
-B build.cmake \
-G "Unix Makefiles" \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF \
-DCPM_USE_LOCAL_PACKAGES:BOOL=ON \
-DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF \
-DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON
- |
# cmake
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
@ -49,7 +56,7 @@ Debian stable Clang:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.cmake --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -32,7 +32,7 @@ Debian stable:i386:
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:i386 libpng-dev:i386 libcurl4-openssl-dev:i386 libgme-dev:i386 libopenmpt-dev:i386 libminiupnpc-dev:i386
- apt-get install libsdl2-dev:i386 libpng-dev:i386 libcurl4-openssl-dev:i386 libyuv-dev:i386 libminiupnpc-dev:i386
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
@ -40,7 +40,12 @@ Debian stable:i386:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
cmake \
--preset ninja-debug \
-B build.cmake \
-G "Unix Makefiles" \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
# cmake
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
@ -48,7 +53,7 @@ Debian stable:i386:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.cmake --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -9,14 +9,7 @@ Debian testing Clang:
artifacts:
paths:
- "build.clang/bin/"
- "build.clang/src/config.h"
- "build.cmake/bin/"
- "build.cmake/src/config.h"
expose_as: "testing-clang"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-clang"
variables:
CC: clang
CXX: clang
WFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror -Wno-deprecated-non-prototype -Wno-single-bit-bitfield-constant-conversion
CFLAGS: -Wno-cast-align -Wno-implicit-const-int-float-conversion -Werror -Wno-deprecated-non-prototype -Wno-single-bit-bitfield-constant-conversion
LDFLAGS: -Wl,-fuse-ld=gold

View file

@ -17,12 +17,8 @@ Debian testing GCC:
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-gcc"
variables:
CC: /usr/bin/x86_64-linux-gnu-gcc
CXX: /usr/bin/x86_64-linux-gnu-g++
OBJCOPY: /usr/bin/x86_64-linux-gnu-objcopy
OBJDUMP: /usr/bin/x86_64-linux-gnu-objdump
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig
LD: /usr/bin/x86_64-linux-gnu-ld
CC: gcc
CXX: g++
script:
- - |
@ -36,7 +32,7 @@ Debian testing GCC:
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev libminiupnpc-dev
- apt-get install libsdl2-dev libpng-dev libcurl4-openssl-dev libyuv-dev libminiupnpc-dev
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
@ -44,7 +40,12 @@ Debian testing GCC:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.cmake -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
cmake \
--preset ninja-debug \
-B build.cmake \
-G "Unix Makefiles" \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF
- |
# cmake
echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
@ -52,7 +53,7 @@ Debian testing GCC:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.cmake --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -17,11 +17,6 @@ osxcross arm64:
- build/apt-cache
unprotect: true
- key: vcpkg-root
paths:
- build/vcpkg-root
unprotect: true
- key: vcpkg-binary-cache-arm64-osx
paths:
- build/vcpkg-binary-cache
@ -32,40 +27,32 @@ osxcross arm64:
- "build.arm64/bin/"
- "build.arm64/dist/arm64.h"
- "build.arm64/src/config.h"
expose_as: "Mac arm64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-arm64-apple-darwin21.4"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-arm64-apple-darwin"
variables:
OSXCROSS_HOST: arm64-apple-darwin21.4
LD: arm64-apple-darwin21.4-ld
CMAKE_TOOLCHAIN_FILE: /osxcross/toolchain.cmake
CCACHE_CPP2: yes
script:
- |
# vcpkg
echo -e "\e[0Ksection_start:`date +%s`:vcpkg-root[collapsed=true]\r\e[0KUpdating vcpkg"
if [ -d "build/vcpkg-root" ]; then
pushd build/vcpkg-root
git fetch https://github.com/Microsoft/vcpkg master
git reset --hard FETCH_HEAD
popd
else
mkdir -p build
git clone https://github.com/Microsoft/vcpkg build/vcpkg-root
fi
export VCPKG_ROOT=$(pwd)/build/vcpkg-root
export VCPKG_BINARY_SOURCES="clear;files,$(pwd)/build/vcpkg-binary-cache,readwrite"
mkdir -p "build/vcpkg-binary-cache"
echo -e "\e[0Ksection_end:`date +%s`:vcpkg-root\r\e[0K"
- - |
# osxcross Config
echo -e "\e[0Ksection_start:`date +%s`:osxcross_Config[collapsed=true]\r\e[0Kosxcross Config"
- export VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${OSXCROSS_TARGET_DIR}/toolchain.cmake
- export PATH="/opt/osxcross.arm64:${PATH}"
- $(osxcross-conf)
- export OSXCROSS_HOST=arm64-apple-${OSXCROSS_TARGET}
- export VCPKG_DEFAULT_TRIPLET=arm64-osx
- export CC=${OSXCROSS_TARGET_DIR}/bin/${OSXCROSS_HOST}-clang
- export CXX=${OSXCROSS_TARGET_DIR}/bin/${OSXCROSS_HOST}-clang++
- export SDKROOT=${OSXCROSS_SDK}
- |
# osxcross Config
echo -e "\e[0Ksection_end:`date +%s`:osxcross_Config\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages"
- osxcross-macports install --arm64 libxmp wavpack libopenmpt opusfile || osxcross-macports install --arm64 libxmp wavpack libopenmpt opusfile
- osxcross-macports install --static --arm64 curl libsdl2_mixer libpng || osxcross-macports install --static --arm64 curl libsdl2_mixer libpng
- osxcross-macports install --static --arm64 miniupnpc curl libpng || osxcross-macports install --verbose --static --arm64 miniupnpc curl libpng
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K"
@ -73,7 +60,21 @@ osxcross arm64:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.arm64 --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -DSRB2_SDL2_EXE_NAME=ringracers_$CI_PIPELINE_ID
- |
cmake \
--preset ninja-debug \
-B build.arm64 \
-G "Unix Makefiles" \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF \
-DCPM_USE_LOCAL_PACKAGES:BOOL=ON \
-DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" \
-DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" \
-DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF \
-DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON \
-DSRB2_SDL2_EXE_NAME=ringracers_$CI_PIPELINE_ID \
-DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS:BOOL=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
@ -81,7 +82,7 @@ osxcross arm64:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.arm64 --parallel 1 --verbose
- cmake --build build.arm64 --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
@ -93,35 +94,4 @@ osxcross arm64:
- cp --reflink=auto --sparse=always --verbose build.arm64/src/config.h build.arm64/dist/arm64.h
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:copy\r\e[0K"
after_script:
- - |
# apt_clean
echo -e "\e[0Ksection_start:`date +%s`:apt_clean[collapsed=true]\r\e[0KCleaning of unneeded APT packages"
- apt-get autoclean
- |
# apt_clean
echo -e "\e[0Ksection_end:`date +%s`:apt_clean\r\e[0K"
- - |
# vcpkg_clean
echo -e "\e[0Ksection_start:`date +%s`:vcpkg_clean[collapsed=true]\r\e[0KCleaning vcpkg-root"
if [ -d "build/vcpkg-root" ]; then
pushd "build/vcpkg-root"
git clean
popd
fi
echo -e "\e[0Ksection_end:`date +%s`:vcpkg_clean\r\e[0K"
- - |
# ccache_stats
echo -e "\e[0Ksection_start:`date +%s`:ccache_stats[collapsed=true]\r\e[0Kccache statistics:"
- ccache --show-stats
- ccache --show-log-stats || true
- |
# ccahe_stats
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
echo -e "\e[0Ksection_end:`date +%s`:copy\r\e[0K"

View file

@ -17,11 +17,6 @@ osxcross x86_64:
- build/apt-cache
unprotect: true
- key: vcpkg-root
paths:
- build/vcpkg-root
unprotect: true
- key: vcpkg-binary-cache-x64-osx
paths:
- build/vcpkg-binary-cache
@ -32,40 +27,32 @@ osxcross x86_64:
- "build.x86_64/bin/"
- "build.x86_64/dist/x86_64.h"
- "build.x86_64/src/config.h"
expose_as: "Mac x86_64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-x86_64-apple-darwin21.4"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-x86_64-apple-darwin"
variables:
OSXCROSS_HOST: x86_64-apple-darwin21.4
LD: x86_64-apple-darwin21.4-ld
CMAKE_TOOLCHAIN_FILE: /osxcross/toolchain.cmake
CCACHE_CPP2: yes
script:
- |
# vcpkg
echo -e "\e[0Ksection_start:`date +%s`:vcpkg-root[collapsed=true]\r\e[0KUpdating vcpkg"
if [ -d "build/vcpkg-root" ]; then
pushd build/vcpkg-root
git fetch https://github.com/Microsoft/vcpkg master
git reset --hard FETCH_HEAD
popd
else
mkdir -p build
git clone https://github.com/Microsoft/vcpkg build/vcpkg-root
fi
export VCPKG_ROOT=$(pwd)/build/vcpkg-root
export VCPKG_BINARY_SOURCES="clear;files,$(pwd)/build/vcpkg-binary-cache,readwrite"
mkdir -p "build/vcpkg-binary-cache"
echo -e "\e[0Ksection_end:`date +%s`:vcpkg-root\r\e[0K"
- - |
# osxcross Config
echo -e "\e[0Ksection_start:`date +%s`:osxcross_Config[collapsed=true]\r\e[0Kosxcross Config"
- export VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${OSXCROSS_TARGET_DIR}/toolchain.cmake
- export PATH="/opt/osxcross.x86_64:${PATH}"
- $(osxcross-conf)
- export OSXCROSS_HOST=x86_64-apple-${OSXCROSS_TARGET}
- export VCPKG_DEFAULT_TRIPLET=x64-osx
- export CC=${OSXCROSS_TARGET_DIR}/bin/${OSXCROSS_HOST}-clang
- export CXX=${OSXCROSS_TARGET_DIR}/bin/${OSXCROSS_HOST}-clang++
- export SDKROOT=${OSXCROSS_SDK}
- |
# osxcross Config
echo -e "\e[0Ksection_end:`date +%s`:osxcross_Config\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages"
- osxcross-macports install libxmp wavpack libopenmpt opusfile || osxcross-macports install libxmp wavpack libopenmpt opusfile
- osxcross-macports install --static curl libsdl2_mixer libpng || osxcross-macports install --static curl libsdl2_mixer libpng
- osxcross-macports install --static miniupnpc curl libpng || osxcross-macports install --verbose --static miniupnpc curl libpng
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K"
@ -73,7 +60,20 @@ osxcross x86_64:
- - |
# cmake
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- cmake -B build.x86_64 --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF -DSRB2_SDL2_EXE_NAME=ringracers_$CI_PIPELINE_ID
- |
cmake \
--preset ninja-debug \
-B build.x86_64 \
-G "Unix Makefiles" \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF \
-DCPM_USE_LOCAL_PACKAGES:BOOL=ON \
-DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" \
-DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" \
-DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF \
-DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON \
-DSRB2_SDL2_EXE_NAME=ringracers_$CI_PIPELINE_ID \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
@ -81,7 +81,7 @@ osxcross x86_64:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.x86_64 --parallel 1 --verbose
- cmake --build build.x86_64 --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
@ -93,35 +93,4 @@ osxcross x86_64:
- cp --reflink=auto --sparse=always --verbose build.x86_64/src/config.h build.x86_64/dist/x86_64.h
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:copy\r\e[0K"
after_script:
- - |
# apt_clean
echo -e "\e[0Ksection_start:`date +%s`:apt_clean[collapsed=true]\r\e[0KCleaning of unneeded APT packages"
- apt-get autoclean
- |
# apt_clean
echo -e "\e[0Ksection_end:`date +%s`:apt_clean\r\e[0K"
- - |
# vcpkg_clean
echo -e "\e[0Ksection_start:`date +%s`:vcpkg_clean[collapsed=true]\r\e[0KCleaning vcpkg-root"
if [ -d "build/vcpkg-root" ]; then
pushd "build/vcpkg-root"
git clean
popd
fi
echo -e "\e[0Ksection_end:`date +%s`:vcpkg_clean\r\e[0K"
- - |
# ccache_stats
echo -e "\e[0Ksection_start:`date +%s`:ccache_stats[collapsed=true]\r\e[0Kccache statistics:"
- ccache --show-stats
- ccache --show-log-stats || true
- |
# ccahe_stats
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
echo -e "\e[0Ksection_end:`date +%s`:copy\r\e[0K"

View file

@ -9,6 +9,25 @@ Windows x64:
allow_failure: true
cache:
- key: ccache-$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG
fallback_keys:
- ccache-$CI_JOB_NAME_SLUG-$CI_DEFAULT_BRANCH
- ccache-$CI_JOB_NAME_SLUG-master
paths:
- build/ccache
- build/ccache_statslog
- key: apt-$CI_JOB_IMAGE
paths:
- build/apt-cache
unprotect: true
- key: vcpkg-binary-cache-x64-mingw-static
paths:
- build/vcpkg-binary-cache
unprotect: true
artifacts:
paths:
- "build.cmake/bin/"
@ -17,11 +36,22 @@ Windows x64:
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win64"
variables:
PREFIX: x86_64-w64-mingw32
CC: /usr/lib/ccache/x86_64-w64-mingw32-gcc-12-posix
CXX: /usr/lib/ccache/x86_64-w64-mingw32-g++
VCPKG_TARGET_TRIPLET: x64-mingw-static
CC: x86_64-w64-mingw32-gcc
CXX: x86_64-w64-mingw32-g++
LD: x86_64-w64-mingw32-ld
script:
- |
# vcpkg
echo -e "\e[0Ksection_start:`date +%s`:vcpkg-root[collapsed=true]\r\e[0KSetting vcpkg cache"
export VCPKG_DEFAULT_BINARY_CACHE="$(pwd)/build/vcpkg-binary-cache"
mkdir -p "build/vcpkg-binary-cache"
echo -e "\e[0Ksection_end:`date +%s`:vcpkg-root\r\e[0K"
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
@ -43,16 +73,14 @@ Windows x64:
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- |
cmake \
--preset ninja-debug \
-B build.cmake \
-G "Unix Makefiles" \
-DSRB2_USE_CCACHE=NO \
-DCMAKE_C_COMPILER=/usr/lib/ccache/x86_64-w64-mingw32-gcc-12-posix \
-DCMAKE_CXX_COMPILER=/usr/lib/ccache/x86_64-w64-mingw32-g++ \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/toolchains/mingw.cmake \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF \
-DSRB2_CONFIG_ENABLE_DISCORDRPC=OFF \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-mingw-static \
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} \
-DSRB2_CONFIG_ALWAYS_MAKE_DEBUGLINK=ON
- |
# cmake
@ -61,7 +89,7 @@ Windows x64:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build build.cmake --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -21,11 +21,6 @@ Windows x86:
- build/apt-cache
unprotect: true
- key: vcpkg-root
paths:
- build/vcpkg-root
unprotect: true
- key: vcpkg-binary-cache-x86-mingw-static
paths:
- build/vcpkg-binary-cache
@ -33,33 +28,23 @@ Windows x86:
artifacts:
paths:
- "build/ninja-x86_mingw_static_vcpkg-debug/bin/"
- "build/ninja-x86_mingw_static_vcpkg-debug/src/config.h"
- "build.cmake/bin/"
- "build.cmake/src/config.h"
expose_as: "Win32"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Win32"
variables:
PREFIX: i686-w64-mingw32
CC: /usr/lib/ccache/i686-w64-mingw32-gcc-12-posix
CXX: /usr/lib/ccache/i686-w64-mingw32-g++
VCPKG_TARGET_TRIPLET: x86-mingw-static
CC: i686-w64-mingw32-gcc
CXX: i686-w64-mingw32-g++
LD: i686-w64-mingw32-ld
script:
- |
# vcpkg
echo -e "\e[0Ksection_start:`date +%s`:vcpkg-root[collapsed=true]\r\e[0KUpdating vcpkg"
echo -e "\e[0Ksection_start:`date +%s`:vcpkg-root[collapsed=true]\r\e[0KSetting vcpkg cache"
if [ -d "build/vcpkg-root" ]; then
pushd build/vcpkg-root
git fetch https://github.com/Microsoft/vcpkg master
git reset --hard FETCH_HEAD
popd
else
mkdir -p build
git clone https://github.com/Microsoft/vcpkg build/vcpkg-root
fi
export VCPKG_ROOT=$(pwd)/build/vcpkg-root
export VCPKG_BINARY_SOURCES="clear;files,$(pwd)/build/vcpkg-binary-cache,readwrite"
export VCPKG_DEFAULT_BINARY_CACHE="$(pwd)/build/vcpkg-binary-cache"
mkdir -p "build/vcpkg-binary-cache"
@ -86,16 +71,14 @@ Windows x86:
echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles"
- |
cmake \
--preset ninja-x86_mingw_static_vcpkg-debug \
--preset ninja-debug \
-B build.cmake \
-G "Unix Makefiles" \
-DSRB2_USE_CCACHE=NO \
-DCMAKE_C_COMPILER=/usr/lib/ccache/i686-w64-mingw32-gcc-12-posix \
-DCMAKE_CXX_COMPILER=/usr/lib/ccache/i686-w64-mingw32-g++ \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/toolchains/mingw.cmake \
-DSRB2_CONFIG_ENABLE_WEBM_MOVIES=OFF \
-DSRB2_CONFIG_ENABLE_DISCORDRPC=OFF \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x86-mingw-static \
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} \
-DSRB2_CONFIG_ALWAYS_MAKE_DEBUGLINK=ON
- |
# cmake
@ -104,37 +87,7 @@ Windows x86:
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- cmake --build --preset ninja-x86_mingw_static_vcpkg-debug --parallel 1 --verbose
- cmake --build build.cmake --parallel 1 --verbose -- --keep-going
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
after_script:
- - |
# apt_clean
echo -e "\e[0Ksection_start:`date +%s`:apt_clean[collapsed=true]\r\e[0KCleaning of unneeded APT packages"
- apt-get autoclean
- |
# apt_clean
echo -e "\e[0Ksection_end:`date +%s`:apt_clean\r\e[0K"
- - |
# vcpkg_clean
echo -e "\e[0Ksection_start:`date +%s`:vcpkg_clean[collapsed=true]\r\e[0KCleaning vcpkg-root"
if [ -d "build/vcpkg-root" ]; then
pushd "build/vcpkg-root"
git clean -f
popd
fi
echo -e "\e[0Ksection_end:`date +%s`:vcpkg_clean\r\e[0K"
- - |
# ccache_stats
echo -e "\e[0Ksection_start:`date +%s`:ccache_stats[collapsed=true]\r\e[0Kccache statistics:"
- ccache --show-stats
- ccache --show-log-stats || true
- |
# ccahe_stats
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"

View file

@ -93,26 +93,24 @@
- - |
# ccache_config
echo -e "\e[0Ksection_start:`date +%s`:ccache_config[collapsed=true]\r\e[0KSetting up ccache config"
- mkdir --parents --verbose ~/.ccache/
- touch ~/.ccache/ccache.conf
- |
# cache.conf
echo Adding ccache configution option
- |
# base_dir
echo base_dir = $CI_PROJECT_DIR | tee --append ~/.ccache/ccache.conf
ccache --set-config base_dir=$CI_PROJECT_DIR
- |
# cache_dir
echo cache_dir = $CI_PROJECT_DIR/build/ccache | tee --append ~/.ccache/ccache.conf
ccache --set-config cache_dir=$CI_PROJECT_DIR/build/ccache
- |
# compiler_check
echo compiler_check = content | tee --append ~/.ccache/ccache.conf
ccache --set-config compiler_check=content
- |
# stats_log
echo stats_log = $CI_PROJECT_DIR/build/ccache_statslog | tee --append ~/.ccache/ccache.conf
ccache --set-config stats_log=$CI_PROJECT_DIR/build/ccache_statslog || true
- |
# max_size
echo max_size = 300M | tee --append ~/.ccache/ccache.conf
ccache --set-config max_size=300M
- |
# ccache_config
echo -e "\e[0Ksection_end:`date +%s`:ccache_config\r\e[0K"

View file

@ -53,7 +53,19 @@ SET(CPACK_OUTPUT_FILE_PREFIX package)
include(CPack)
# Options
if("${CMAKE_SYSTEM_NAME}" MATCHES Windows)
if(DEFINED VCPKG_TARGET_TRIPLET)
set(SRB2_CONFIG_SYSTEM_LIBRARIES_DEFAULT ON)
else()
set(SRB2_CONFIG_SYSTEM_LIBRARIES_DEFAULT OFF)
endif()
else()
set(SRB2_CONFIG_SYSTEM_LIBRARIES_DEFAULT ON)
endif()
# Clang tidy options will be ignored if CMAKE_<LANG>_CLANG_TIDY are set.
option(SRB2_CONFIG_ENABLE_CLANG_TIDY_C "Enable default clang-tidy check configuration for C" OFF)
option(SRB2_CONFIG_ENABLE_CLANG_TIDY_CXX "Enable default clang-tidy check configuration for C++" OFF)
option(
SRB2_CONFIG_STATIC_STDLIB
"Link static version of standard library. All dependencies must also be static"
@ -70,8 +82,10 @@ option(SRB2_CONFIG_ALWAYS_MAKE_DEBUGLINK "Always make a debuglink .debug." OFF)
option(SRB2_CONFIG_TESTERS "Compile a build for testers." OFF)
option(SRB2_CONFIG_MOBJCONSISTANCY "Compile with MOBJCONSISTANCY defined." OFF)
option(SRB2_CONFIG_PACKETDROP "Compile with PACKETDROP defined." OFF)
option(SRB2_CONFIG_EXECINFO "Enable stack trace dump support." ON)
option(SRB2_CONFIG_ZDEBUG "Compile with ZDEBUG defined." OFF)
option(SRB2_CONFIG_SKIP_COMPTIME "Skip regenerating comptime. To speed up iterative debug builds in IDEs." OFF)
option(SRB2_CONFIG_FORCE_NO_MS_BITFIELDS "Compile without -mno-ms-bitfields compiler flag" OFF)
# SRB2_CONFIG_PROFILEMODE is probably superceded by some CMake setting.
option(SRB2_CONFIG_PROFILEMODE "Compile for profiling (GCC only)." OFF)
option(SRB2_CONFIG_TRACY "Compile with Tracy profiling enabled" OFF)
@ -94,8 +108,18 @@ if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL Windows)
endif()
endif()
# Dependencies
add_subdirectory(thirdparty)
if(SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES)
set(SRB2_INTERNAL_LIBRARY_TYPE SHARED)
set(NOT_SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES OFF)
else()
set(SRB2_INTERNAL_LIBRARY_TYPE STATIC)
set(NOT_SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES ON)
endif()
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
find_package(SDL2 CONFIG REQUIRED)

View file

@ -101,88 +101,113 @@
"name": "ninja-debug",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__debug", "__ninja"]
"inherits": [ "__debug", "__ninja" ]
},
{
"name": "ninja-develop",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__develop", "__ninja"]
"inherits": [ "__develop", "__ninja" ]
},
{
"name": "ninja-release",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__release", "__ninja"]
"inherits": [ "__release", "__ninja" ]
},
{
"name": "ninja-testers",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__testers", "__ninja"]
"inherits": [ "__testers", "__ninja" ]
},
{
"name": "ninja-vcpkg-debug",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": [ "__debug", "__ninja", "__vcpkg-toolchain" ]
},
{
"name": "ninja-vcpkg-develop",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": [ "__develop", "__ninja", "__vcpkg-toolchain" ]
},
{
"name": "ninja-vcpkg-release",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": [ "__release", "__ninja", "__vcpkg-toolchain" ]
},
{
"name": "ninja-vcpkg-testers",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": [ "__testers", "__ninja", "__vcpkg-toolchain" ]
},
{
"name": "ninja-x86_mingw_static_vcpkg-debug",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__debug", "__compiler-mingw-w64-i686", "__ninja", "__vcpkg-toolchain", "__mingw-static"]
"inherits": [ "__debug", "__compiler-mingw-w64-i686", "__ninja", "__vcpkg-toolchain", "__mingw-static" ]
},
{
"name": "ninja-x86_mingw_static_vcpkg-develop",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__develop", "__compiler-mingw-w64-i686", "__ninja", "__vcpkg-toolchain", "__mingw-static"]
"inherits": [ "__develop", "__compiler-mingw-w64-i686", "__ninja", "__vcpkg-toolchain", "__mingw-static" ]
},
{
"name": "ninja-x86_mingw_static_vcpkg-release",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__release", "__compiler-mingw-w64-i686", "__ninja", "__vcpkg-toolchain", "__mingw-static"]
"inherits": [ "__release", "__compiler-mingw-w64-i686", "__ninja", "__vcpkg-toolchain", "__mingw-static" ]
},
{
"name": "ninja-x86_mingw_static_vcpkg-testers",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__testers", "__compiler-mingw-w64-i686", "__ninja", "__vcpkg-toolchain", "__mingw-static"]
"inherits": [ "__testers", "__compiler-mingw-w64-i686", "__ninja", "__vcpkg-toolchain", "__mingw-static" ]
},
{
"name": "ninja-x64_osx_vcpkg-debug",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__debug", "__ninja", "__vcpkg-toolchain", "__osx_x64"]
"inherits": [ "__debug", "__ninja", "__vcpkg-toolchain", "__osx_x64" ]
},
{
"name": "ninja-x64_osx_vcpkg-develop",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__develop", "__ninja", "__vcpkg-toolchain", "__osx_x64"]
"inherits": [ "__develop", "__ninja", "__vcpkg-toolchain", "__osx_x64" ]
},
{
"name": "ninja-x64_osx_vcpkg-release",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__release", "__ninja", "__vcpkg-toolchain", "__osx_x64"]
"inherits": [ "__release", "__ninja", "__vcpkg-toolchain", "__osx_x64" ]
},
{
"name": "ninja-arm64_osx_vcpkg-debug",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__debug", "__ninja", "__vcpkg-toolchain", "__osx_arm64"]
"inherits": [ "__debug", "__ninja", "__vcpkg-toolchain", "__osx_arm64" ]
},
{
"name": "ninja-arm64_osx_vcpkg-develop",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__develop", "__ninja", "__vcpkg-toolchain", "__osx_arm64"]
"inherits": [ "__develop", "__ninja", "__vcpkg-toolchain", "__osx_arm64" ]
},
{
"name": "ninja-arm64_osx_vcpkg-release",
"hidden": false,
"binaryDir": "build/${presetName}",
"inherits": ["__release", "__ninja", "__vcpkg-toolchain", "__osx_arm64"]
"inherits": [ "__release", "__ninja", "__vcpkg-toolchain", "__osx_arm64" ]
}
],

View file

@ -205,7 +205,10 @@ if(("${CMAKE_COMPILER_IS_GNUCC}" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND
target_link_options(SRB2SDL2 PRIVATE "-Wl,--disable-dynamicbase")
if("${SRB2_CONFIG_STATIC_STDLIB}")
# On MinGW with internal libraries, link the standard library statically
target_link_options(SRB2SDL2 PRIVATE "-static")
target_link_options(SRB2SDL2 PRIVATE -Wl,--add-stdcall-alias -static-libgcc -static-libstdc++ -static -lpthread)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
target_link_libraries(SRB2SDL2 PRIVATE Threads::Threads)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
target_link_options(SRB2SDL2 PRIVATE "-Wl,--large-address-aware")
@ -239,6 +242,10 @@ if (UNIX)
target_compile_definitions(SRB2SDL2 PRIVATE -DUNIXCOMMON)
endif()
if (BSD MATCHES "FreeBSD")
target_compile_definitions(SRB2SDL2 PRIVATE -DFREEBSD)
endif()
if(CMAKE_COMPILER_IS_GNUCC)
find_program(OBJCOPY objcopy)
endif()
@ -250,6 +257,11 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
endif()
endif()
if("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku")
target_compile_definitions(SRB2SDL2 PRIVATE -DNOEXECINFO)
target_link_libraries(SRB2SDL2 PRIVATE network)
endif()
if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
target_compile_definitions(SRB2SDL2 PRIVATE -DMACOSX)
endif()
@ -408,10 +420,12 @@ endif()
# Compatibility flag with later versions of GCC
# We should really fix our code to not need this
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
check_cxx_compiler_flag("-mno-ms-bitfields" HAS_NO_MS_BITFIELDS)
if(HAS_NO_MS_BITFIELDS)
target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields)
if (NOT SRB2_CONFIG_FORCE_NO_MS_BITFIELDS)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
check_cxx_compiler_flag("-mno-ms-bitfields" HAS_NO_MS_BITFIELDS)
if(HAS_NO_MS_BITFIELDS)
target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields)
endif()
endif()
endif()
@ -581,6 +595,11 @@ endif()
if(SRB2_CONFIG_PACKETDROP)
target_compile_definitions(SRB2SDL2 PRIVATE -DPACKETDROP)
endif()
if(SRB2_CONFIG_EXECINFO)
else()
target_compile_definitions(SRB2SDL2 PRIVATE -DNOEXECINFO)
message(STATUS "You have disabled stack trace dump support")
endif()
if(SRB2_CONFIG_ZDEBUG)
target_compile_definitions(SRB2SDL2 PRIVATE -DZDEBUG)
endif()
@ -624,25 +643,167 @@ if((CMAKE_COMPILER_IS_GNUCC OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND NOT
endif()
# copy DLLs to bin/ directory if building internal shared on windows
if("${CMAKE_SYSTEM_NAME}" STREQUAL Windows AND NOT "${SRB2_CONFIG_INTERNAL_LIBRARIES}" AND "${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}")
if("${CMAKE_SYSTEM_NAME}" STREQUAL Windows AND NOT "${SRB2_CONFIG_INTERNAL_LIBRARIES}")
# also copy implicitly linked system libraries
set(ADDITIONAL_DLLS "")
if("${CMAKE_C_COMPILER_ID}" STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# also copy implicitly linked system libraries
get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
if("${CMAKE_C_COMPILER_ID}" STREQUAL GNU)
list(APPEND ADDITIONAL_DLLS
"libgcc_s_dw2-1.dll"
"libstdc++-6.dll"
"libwinpthread-1.dll"
)
else()
list(APPEND ADDITIONAL_DLLS
"libunwind.dll"
"libc++.dll"
"libwinpthread-1.dll"
)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL GNU)
string(CONCAT gcc_search_dirs_path "${CMAKE_BINARY_DIR}" /gcc_search_dirs.txt)
#message(STATUS gcc_search_dirs_path=${gcc_search_dirs_path})
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -print-search-dirs
OUTPUT_FILE "${gcc_search_dirs_path}"
#OUTPUT_VARIABLE gcc_search_dirs
)
file(READ "${gcc_search_dirs_path}" gcc_search_dirs)
#message(STATUS gcc_search_dirs=${gcc_search_dirs})
#set(gcc_install_dir "${gcc_search_dirs}")
#string(REGEX MATCH "install: =[ \t]*([^\r\n]*)" gcc_install_dir "${gcc_install_dir}" )
#set(gcc_install_dir "${CMAKE_MATCH_1}")
#message(STATUS gcc_install_dir="${gcc_install_dir}")
string(CONCAT gcc_search_dirs_install_path_1 "${CMAKE_BINARY_DIR}" /gcc_search_dirs_install_1.txt)
#message(STATUS gcc_search_dirs_install_path_1=${gcc_search_dirs_install_path_1})
execute_process(
COMMAND grep "^install:"
INPUT_FILE "${gcc_search_dirs_path}"
OUTPUT_FILE "${gcc_search_dirs_install_path_1}"
)
string(CONCAT gcc_search_dirs_install_path_2 "${CMAKE_BINARY_DIR}" /gcc_search_dirs_install_2.txt)
#message(STATUS gcc_search_dirs_install_path_2=${gcc_search_dirs_install_path_2})
execute_process(
COMMAND sed -e "s/^install: //" -e "s,=/,/,g"
INPUT_FILE "${gcc_search_dirs_install_path_1}"
OUTPUT_FILE "${gcc_search_dirs_install_path_2}"
)
if(NOT ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows"))
string(REPLACE ":" ";" gcc_install_dir "${gcc_install_dir}")
endif()
list(TRANSFORM ADDITIONAL_DLLS PREPEND "${MINGW_BIN_PATH}/")
file(READ ${gcc_search_dirs_install_path_2} gcc_install_dir)
#set(gcc_programs_dir "${gcc_search_dirs}")
#string(REGEX MATCH "programs: =[ \t]*([^\r\n]*)" gcc_programs_dir "${gcc_programs_dir}" )
#set(gcc_programs_dir "${CMAKE_MATCH_1}")
#message(STATUS gcc_programs_dir="${gcc_programs_dir}")
string(CONCAT gcc_search_dirs_programs_path_1 "${CMAKE_BINARY_DIR}" /gcc_search_dirs_programs_1.txt)
#message(STATUS gcc_search_dirs_programs_path_1=${gcc_search_dirs_programs_path_1})
execute_process(
COMMAND grep "^programs:"
INPUT_FILE "${gcc_search_dirs_path}"
OUTPUT_FILE "${gcc_search_dirs_programs_path_1}"
)
string(CONCAT gcc_search_dirs_programs_path_2 "${CMAKE_BINARY_DIR}" /gcc_search_dirs_programs_2.txt)
#message(STATUS gcc_search_dirs_programs_path_2=${gcc_search_dirs_programs_path_2})
execute_process(
COMMAND sed -e "s/^programs: =//" -e "s,=/,/,g"
INPUT_FILE "${gcc_search_dirs_programs_path_1}"
OUTPUT_FILE "${gcc_search_dirs_programs_path_2}"
)
file(READ ${gcc_search_dirs_programs_path_2} gcc_programs_dir)
if(NOT ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows"))
string(REPLACE ":" ";" gcc_programs_dir "${gcc_programs_dir}")
endif()
#set(gcc_libraries_dir "${gcc_search_dirs}")
#string(REGEX MATCH "libraries: =[ \t]*([^\r\n]*)" gcc_libraries_dir "${gcc_libraries_dir}" )
#set(gcc_libraries_dir "${CMAKE_MATCH_1}")
#message(STATUS gcc_libraries_dir="${gcc_libraries_dir}")
string(CONCAT gcc_search_dirs_libraries_path_1 "${CMAKE_BINARY_DIR}" /gcc_search_dirs_libraries_1.txt)
#message(STATUS gcc_search_dirs_libraries_path_1=${gcc_search_dirs_libraries_path_1})
execute_process(
COMMAND grep "^libraries:"
INPUT_FILE "${gcc_search_dirs_path}"
OUTPUT_FILE "${gcc_search_dirs_libraries_path_1}"
)
string(CONCAT gcc_search_dirs_libraries_path_2 "${CMAKE_BINARY_DIR}" /gcc_search_dirs_libraries_2.txt)
#message(STATUS gcc_search_dirs_libraries_path_2=${gcc_search_dirs_libraries_path_2})
execute_process(
COMMAND sed -e "s/^libraries: =//" -e "s,=/,/,g"
INPUT_FILE "${gcc_search_dirs_libraries_path_1}"
OUTPUT_FILE "${gcc_search_dirs_libraries_path_2}"
)
file(READ ${gcc_search_dirs_libraries_path_2} gcc_libraries_dir)
if(NOT ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows"))
string(REPLACE ":" ";" gcc_libraries_dir "${gcc_libraries_dir}")
endif()
#list(LENGTH gcc_install_dir gcc_install_dir_len)
#list(LENGTH gcc_programs_dir gcc_programs_dir_len)
#list(LENGTH gcc_libraries_dir gcc_libraries_dir_len)
#message(STATUS gcc_install_dir_len="${gcc_install_dir_len}")
#message(STATUS gcc_install_dir="${gcc_install_dir}")
#message(STATUS gcc_programs_dir_len="${gcc_programs_dir_len}")
#message(STATUS gcc_programs_dir="${gcc_programs_dir}")
#message(STATUS gcc_libraries_dir_len="${gcc_libraries_dir_len}")
#message(STATUS gcc_libraries_dir="${gcc_libraries_dir}")
get_filename_component(CMAKE_CXX_COMPILER_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
#message(STATUS CMAKE_CXX_COMPILER_DIR="${CMAKE_CXX_COMPILER_DIR}")
set(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES "" ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(OLD_CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
set(CMAKE_FIND_LIBRARY_PREFIXES "" ${CMAKE_FIND_LIBRARY_PREFIXES})
find_library(LIBUNWIND
NAMES "libunwind.dll"
PATHS ${gcc_programs_dir} ${CMAKE_CXX_COMPILER_DIR}
)
if (LIBUNWIND)
#message(STATUS LIBUNWIND="${LIBUNWIND}")
list(APPEND ADDITIONAL_DLLS ${LIBUNWIND})
endif()
unset(LIBUNWIND)
find_library(LIBGCC
NAMES "libgcc_s_dw2-1.dll" "libgcc_s_sjlj-1.dll" "libgcc_s_seh-1.dll"
PATHS ${gcc_programs_dir} ${CMAKE_CXX_COMPILER_DIR}
)
if (LIBGCC)
#message(STATUS LIBGCC="${LIBGCC}")
list(APPEND ADDITIONAL_DLLS ${LIBGCC})
endif()
unset(LIBGCC)
find_library(LIBSTDCPP
NAMES "libstdc++-6.dll" "libc++.dll"
PATHS ${gcc_programs_dir} ${CMAKE_CXX_COMPILER_DIR}
)
if (LIBSTDCPP)
#message(STATUS LIBSTDCPP="${LIBSTDCPP}")
list(APPEND ADDITIONAL_DLLS ${LIBSTDCPP})
endif()
unset(LIBSTDCPP)
find_library(LIBPTHREAD
NAMES "winpthread-1.dll" "libwinpthread-1.dll" "pthreadGC2.dll"
PATHS ${gcc_libraries_dir} ${CMAKE_CXX_COMPILER_DIR}
)
if(LIBPTHREAD)
#message(STATUS LIBPTHREAD="${LIBPTHREAD}")
list(APPEND ADDITIONAL_DLLS ${LIBPTHREAD})
endif()
set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_PREFIXES ${OLD_CMAKE_FIND_LIBRARY_PREFIXES})
unset(LIBPTHREAD)
unset(gcc_install_dir)
unset(gcc_programs_dir)
unset(gcc_libraries_dir)
unset(OLD_CMAKE_FIND_LIBRARY_SUFFIXES)
unset(OLD_CMAKE_FIND_LIBRARY_PREFIXES)
#message(STATUS ADDITIONAL_DLLS="${ADDITIONAL_DLLS}")
endif()
add_custom_command(TARGET SRB2SDL2 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
@ -654,3 +815,11 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL Windows AND NOT "${SRB2_CONFIG_INTERNAL_LIBRA
COMMENT "Copying runtime DLLs"
)
endif()
# Setup clang-tidy
if(SRB2_CONFIG_ENABLE_CLANG_TIDY_C)
target_set_default_clang_tidy(SRB2SDL2 C "-*,clang-analyzer-*,-clang-analyzer-cplusplus-*")
endif()
if(SRB2_CONFIG_ENABLE_CLANG_TIDY_CXX)
target_set_default_clang_tidy(SRB2SDL2 CXX "-*,clang-analyzer-*,modernize-*")
endif()

View file

@ -1,3 +1,3 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json"
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json"
}

View file

@ -1,16 +1,16 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "ringracers",
"version": "1.0.0",
"dependencies": [
"curl",
"sdl2",
"libpng",
"libogg",
"libvpx",
"libvorbis",
"libyuv",
"zlib"
],
"builtin-baseline": "c591ac6466a55ef0a05a3d56bb1489ca36e50102"
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "ringracers",
"version": "1.0.0",
"builtin-baseline": "d5ec528843d29e3a52d745a64b469f810b2cedbf",
"dependencies": [
"curl",
"libogg",
"libpng",
"libvorbis",
"libvpx",
"libyuv",
"sdl2",
"zlib"
]
}