SDL: ci: Add SDL_WERROR to a few configurations

From 151c23415eec9761b0c5612bbccbd3e2641b5b4d Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 6 Oct 2022 05:27:37 +0200
Subject: [PATCH] ci: Add SDL_WERROR to a few configurations

---
 .github/workflows/android.yml    | 1 +
 .github/workflows/emscripten.yml | 1 +
 .github/workflows/main.yml       | 3 +++
 .github/workflows/msvc.yml       | 3 ++-
 .github/workflows/watcom.yml     | 4 ++--
 5 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index 5c83312be417..8864400b2cdc 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -34,6 +34,7 @@ jobs:
         run: |
           cmake -B build \
             -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
+            -DSDL_WERROR=ON \
             -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
             -DANDROID_ABI=${{ matrix.platform.android_abi }} \
             -DSDL_STATIC_PIC=ON \
diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml
index 3e8647c41712..fae9f9a1ab5c 100644
--- a/.github/workflows/emscripten.yml
+++ b/.github/workflows/emscripten.yml
@@ -13,6 +13,7 @@ jobs:
       - name: Configure CMake
         run: |
           emcmake cmake -S . -B build \
+            -DSDL_WERROR=ON \
             -DSDL_TESTS=ON \
             -DSDL_INSTALL_TESTS=ON \
             -DCMAKE_BUILD_TYPE=Release \
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 6837aee9cb9a..8a2042b3f5da 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -70,6 +70,7 @@ jobs:
       run: |
         cmake -S . -B build -G Ninja \
         -DSDL_TESTS=ON \
+        -DSDL_WERROR=ON \
         -DSDL_INSTALL_TESTS=ON \
         -DCMAKE_INSTALL_PREFIX=cmake_prefix \
         -DCMAKE_BUILD_TYPE=Release \
@@ -101,6 +102,7 @@ jobs:
         (
           cd build-autotools
           ${{ github.workspace }}/configure \
+            --enable-werror \
             --prefix=${{ github.workspace }}/autotools_prefix \
         )
         if test "${{ runner.os }}" != "macOS" ; then
@@ -110,6 +112,7 @@ jobs:
             mkdir -p build-autotools/test
             cd build-autotools/test
             ${{ github.workspace }}/test/configure \
+              --enable-werror \
               --x-includes=/usr/include \
               --x-libraries="/usr/lib/${multiarch}" \
               --prefix=${{ github.workspace }}/autotools_prefix \
diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml
index 9be53548cd98..78468f08cb02 100644
--- a/.github/workflows/msvc.yml
+++ b/.github/workflows/msvc.yml
@@ -19,7 +19,7 @@ jobs:
         - { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 }
         - { name: Windows (ARM),          flags: -A ARM }
         - { name: Windows (ARM64),        flags: -A ARM64 }
-        - { name: UWP (x64),              flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF,
+        - { name: UWP (x64),              flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF, nowerror: true,
             project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' }
 
     steps:
@@ -40,6 +40,7 @@ jobs:
           """))
     - name: Configure (CMake)
       run: cmake -S build -B build `
+        -DSDL_WERROR=${{ !matrix.platform.nowerror }} `
         -DSDL_TESTS=ON `
         -DSDL_INSTALL_TESTS=ON `
         -DSDL2_DISABLE_INSTALL=OFF `
diff --git a/.github/workflows/watcom.yml b/.github/workflows/watcom.yml
index ead7c4724f7f..f36b73e9a198 100644
--- a/.github/workflows/watcom.yml
+++ b/.github/workflows/watcom.yml
@@ -18,10 +18,10 @@ jobs:
       - uses: open-watcom/setup-watcom@v0
       - name: Build SDL2
         run: |
-          wmake -f ${{ matrix.platform.makefile }}
+          wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1
       - name: Build tests
         run: |
-          cd test && wmake -f ${{ matrix.platform.makefile }}
+          cd test && wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1
           cd ..
       - name: Run tests
         if: "matrix.platform.makefile == 'Makefile.w32'"