SDL: cmake+ci: build shared and static libraries on ci

From e203046a5c88d2b451550e07dc32de1f99fc7640 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 16 Feb 2023 20:15:59 +0100
Subject: [PATCH] cmake+ci: build shared and static libraries on ci

---
 .github/workflows/android.yml | 2 ++
 .github/workflows/main.yml    | 2 ++
 .github/workflows/msvc.yml    | 2 ++
 test/CMakeLists.txt           | 4 ++--
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index f66fca1c1701..126cf81cb216 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -43,6 +43,8 @@ jobs:
             -DSDL_CLANG_TIDY=ON \
             -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
             -DANDROID_ABI=${{ matrix.platform.android_abi }} \
+            -DSDL_SHARED=ON \
+            -DSDL_STATIC=ON \
             -DSDL_STATIC_PIC=ON \
             -DSDL_VENDOR_INFO="Github Workflow" \
             -DCMAKE_INSTALL_PREFIX=prefix \
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index e25b4f902439..204570feae8a 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -73,6 +73,8 @@ jobs:
       run: |
         cmake -S . -B build -G Ninja \
           -Wdeprecated -Wdev -Werror \
+          -DSDL_SHARED=ON \
+          -DSDL_STATIC=ON \
           -DSDL_TESTS=ON \
           -DSDL_WERROR=ON \
           -DSDL_INSTALL_TESTS=ON \
diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml
index 067e682312b7..0b8cdcd7e043 100644
--- a/.github/workflows/msvc.yml
+++ b/.github/workflows/msvc.yml
@@ -46,6 +46,8 @@ jobs:
       run: cmake -S build -B build `
         -Wdeprecated -Wdev -Werror `
         -DSDL_WERROR=${{ !matrix.platform.nowerror }} `
+        -DSDL_SHARED=ON `
+        -DSDL_STATIC=ON `
         -DSDL_TESTS=ON `
         -DSDL_INSTALL_TESTS=ON `
         -DSDL_VENDOR_INFO="Github Workflow" `
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e8bb837f108b..df39b1a10f75 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -13,7 +13,7 @@ include(CMakePushCheckState)
 include(GNUInstallDirs)
 
 set(SDL_TESTS_LINK_SHARED_DEFAULT ON)
-if(EMSCRIPTEN OR N3DS OR PS2 OR PSP OR RISCOS OR VITA)
+if(EMSCRIPTEN OR N3DS OR PS2 OR PSP OR VITA)
     set(SDL_TESTS_LINK_SHARED_DEFAULT OFF)
 endif()
 
@@ -27,7 +27,7 @@ else()
 endif()
 
 if(NOT TARGET SDL3::${sdl_name_component})
-    find_package(SDL3 3.0.0 REQUIRED COMPONENTS ${sdl_name_component} SDL3_test)
+    find_package(SDL3 3.0.0 REQUIRED CONFIG COMPONENTS ${sdl_name_component} SDL3_test)
 endif()
 
 # CMake incorrectly detects opengl32.lib being present on MSVC ARM64