From b845c5fbf7482fa95f7b3fec58bd7c7e73a38577 Mon Sep 17 00:00:00 2001 From: numzero Date: Fri, 3 Nov 2023 19:41:21 +0300 Subject: [PATCH 1/2] Use SDL2 by default Except of Android and macOS, for now --- .github/workflows/build.yml | 4 ++-- scripts/ci-build-mingw.sh | 14 ++++++++++---- source/Irrlicht/CMakeLists.txt | 6 +++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb80bbb4f..32cb8a69f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Build run: | - cmake . + cmake . -DUSE_SDL2=OFF make VERBOSE=1 -j2 - name: Test @@ -52,7 +52,7 @@ jobs: - name: Build run: | - cmake . -DBUILD_EXAMPLES=1 -DENABLE_OPENGL=OFF -DENABLE_GLES2=ON + cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=OFF -DENABLE_OPENGL=OFF -DENABLE_GLES2=ON make -j2 - name: Test (headless) diff --git a/scripts/ci-build-mingw.sh b/scripts/ci-build-mingw.sh index b3b898e2c..fb06b229f 100755 --- a/scripts/ci-build-mingw.sh +++ b/scripts/ci-build-mingw.sh @@ -40,10 +40,16 @@ tmp=( -DZLIB_LIBRARY=$libs/zlib/lib/libz.dll.a \ -DZLIB_INCLUDE_DIR=$libs/zlib/include ) -[ $with_sdl -eq 1 ] && tmp+=( - -DUSE_SDL2=ON - -DCMAKE_PREFIX_PATH=$libs/sdl2/lib/cmake -) +if [ $with_sdl -eq 1 ]; then + tmp+=( + -DUSE_SDL2=ON + -DCMAKE_PREFIX_PATH=$libs/sdl2/lib/cmake + ) +else + tmp+=( + -DUSE_SDL2=OFF + ) +fi #[ $with_gl3 -eq 1 ] && tmp+=(-DENABLE_OPENGL=OFF -DENABLE_OPENGL3=ON) cmake . "${tmp[@]}" diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index 630970ae2..36b102f02 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -1,5 +1,9 @@ +if(NOT ANDROID AND NOT APPLE) + set(DEFAULT_SDL2 ON) +endif() + option(BUILD_SHARED_LIBS "Build shared library" TRUE) -option(USE_SDL2 "Use the SDL2 backend" FALSE) +option(USE_SDL2 "Use the SDL2 backend" ${DEFAULT_SDL2}) # Compiler flags From ddcb4e207f1f88ec1c68d8fc5dbd5faf44eedc9d Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 17 Dec 2023 18:44:47 +0100 Subject: [PATCH 2/2] Update scripts/ci-build-mingw.sh --- scripts/ci-build-mingw.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/ci-build-mingw.sh b/scripts/ci-build-mingw.sh index fb06b229f..18011e468 100755 --- a/scripts/ci-build-mingw.sh +++ b/scripts/ci-build-mingw.sh @@ -46,9 +46,7 @@ if [ $with_sdl -eq 1 ]; then -DCMAKE_PREFIX_PATH=$libs/sdl2/lib/cmake ) else - tmp+=( - -DUSE_SDL2=OFF - ) + tmp+=(-DUSE_SDL2=OFF) fi #[ $with_gl3 -eq 1 ] && tmp+=(-DENABLE_OPENGL=OFF -DENABLE_OPENGL3=ON)