SDL_net: cmake: don't buid SDL_net as a shared library on platforms that don't support it

From 47aeb13e92f8774aee6b70709aec49b7df5682b0 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 12 Jan 2024 16:03:05 +0100
Subject: [PATCH] cmake: don't buid SDL_net  as a shared library on  platforms
 that don't support it

---
 CMakeLists.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50eda0a..f3fd4e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,8 +49,13 @@ include(CMakeDependentOption)
 include(CMakePackageConfigHelpers)
 include(GNUInstallDirs)
 
+set(BUILD_SHARED_LIBS_DEFAULT ON)
+if(VITA OR PSP OR PS2 OR N3DS OR RISCOS)
+    set(BUILD_SHARED_LIBS_DEFAULT OFF)
+endif()
+
 option(CMAKE_POSITION_INDEPENDENT_CODE "Build static libraries with -fPIC" ON)
-option(BUILD_SHARED_LIBS "Build the library as a shared library" ON)
+option(BUILD_SHARED_LIBS "Build the library as a shared library" ${BUILD_SHARED_LIBS_DEFAULT})
 
 cmake_dependent_option(SDL3NET_INSTALL "Enable SDL3_net install target" ${SDL3NET_ROOTPROJECT} "${sdl3net_install_enableable}" OFF)
 cmake_dependent_option(SDL3NET_INSTALL_MAN "Install man pages for SDL3_net" ${SDL3NET_ROOTPROJECT} "SDL3NET_INSTALL" OFF)