From 9cf66950c568732a555b42b1dfbcd2f3e8af1f18 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 11 Jul 2025 09:42:20 +0200 Subject: [PATCH] Upgrade SDL build script for SDL3 --- app/deps/sdl.sh | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/app/deps/sdl.sh b/app/deps/sdl.sh index e04deb0d..48f5c4ae 100755 --- a/app/deps/sdl.sh +++ b/app/deps/sdl.sh @@ -5,10 +5,10 @@ cd "$DEPS_DIR" . common process_args "$@" -VERSION=2.32.8 +VERSION=3.2.18 FILENAME=SDL-$VERSION.tar.gz PROJECT_DIR=SDL-release-$VERSION -SHA256SUM=dd35e05644ae527848d02433bec24dd0ea65db59faecf1a0e5d1880c533dac2c +SHA256SUM=51539fa13e546bc50c632beed3f34257de2baa38a4c642048de56377903b4265 cd "$SOURCES_DIR" @@ -35,45 +35,48 @@ else cd "$DIRNAME" conf=( - --prefix="$INSTALL_DIR/$DIRNAME" + -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR/$DIRNAME" ) if [[ "$HOST" == linux ]] then conf+=( - --enable-video-wayland - --enable-video-x11 + -DSDL_WAYLAND=ON + -DSDL_X11=ON ) fi if [[ "$LINK_TYPE" == static ]] then conf+=( - --enable-static - --disable-shared + -DBUILD_SHARED_LIBS=OFF ) else conf+=( - --disable-static - --enable-shared + -DBUILD_SHARED_LIBS=ON ) fi if [[ "$BUILD_TYPE" == cross ]] then + if [[ "$HOST" = win32 ]] + then + TOOLCHAIN_FILENAME="cmake-toolchain-mingw64-i686.cmake" + elif [[ "$HOST" = win64 ]] + then + TOOLCHAIN_FILENAME="cmake-toolchain-mingw64-x86_64.cmake" + else + echo "Unsupported cross-build to host: $HOST" >&2 + exit 1 + fi + conf+=( - --host="$HOST_TRIPLET" + -DCMAKE_TOOLCHAIN_FILE="$SOURCES_DIR/$PROJECT_DIR/build-scripts/$TOOLCHAIN_FILENAME" ) fi - "$SOURCES_DIR/$PROJECT_DIR"/configure "${conf[@]}" + cmake "$SOURCES_DIR/$PROJECT_DIR" "${conf[@]}" fi -make -j -# There is no "make install-strip" -make install -# Strip manually -if [[ "$LINK_TYPE" == shared && "$HOST" == win* ]] -then - ${HOST_TRIPLET}-strip "$INSTALL_DIR/$DIRNAME/bin/SDL2.dll" -fi +cmake --build . +cmake --install .