SDL_net: cmake: don't enable -fPIC for platforms that don't support shared libraries

From aafb5d31a498124a9c89420908c5af7f5bd27d66 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Mon, 15 Jan 2024 00:58:47 +0100
Subject: [PATCH] cmake: don't enable -fPIC for platforms that don't support
 shared libraries

---
 CMakeLists.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4244b5e..646ac63 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,13 +49,13 @@ include(CMakeDependentOption)
 include(CMakePackageConfigHelpers)
 include(GNUInstallDirs)
 
-set(BUILD_SHARED_LIBS_DEFAULT ON)
+set(PLATFORM_SUPPORTS_SHARED ON)
 if(VITA OR PSP OR PS2 OR N3DS OR RISCOS)
-    set(BUILD_SHARED_LIBS_DEFAULT OFF)
+    set(PLATFORM_SUPPORTS_SHARED OFF)
 endif()
 
-option(CMAKE_POSITION_INDEPENDENT_CODE "Build static libraries with -fPIC" ON)
-option(BUILD_SHARED_LIBS "Build the library as a shared library" ${BUILD_SHARED_LIBS_DEFAULT})
+option(CMAKE_POSITION_INDEPENDENT_CODE "Build static libraries with -fPIC" ${PLATFORM_SUPPORTS_SHARED})
+cmake_dependent_option(BUILD_SHARED_LIBS "Build the library as a shared library" ON PLATFORM_SUPPORTS_SHARED OFF)
 
 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)