SDL_image: cmake: use SONAME instead of full name for shared vendored libraries (5a5ab)

From 5a5ab561a0b2720d2b3beab3c77b14f4df990635 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 5 Sep 2023 23:36:47 +0200
Subject: [PATCH] cmake: use SONAME instead of full name for shared vendored
 libraries

---
 cmake/PrivateSdlFunctions.cmake | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/cmake/PrivateSdlFunctions.cmake b/cmake/PrivateSdlFunctions.cmake
index ebc0c1e4..ae925414 100644
--- a/cmake/PrivateSdlFunctions.cmake
+++ b/cmake/PrivateSdlFunctions.cmake
@@ -194,7 +194,12 @@ function(target_get_dynamic_library DEST TARGET)
         else()
             message(WARNING "Unable to extract dynamic library from target=${TARGET}, type=${target_type}.")
         endif()
-        set (result "$<TARGET_FILE_NAME:${TARGET}>")
+        # TARGET_SONAME_FILE is not allowed for DLL target platforms.
+        if(WIN32)
+          set(result "$<TARGET_FILE_NAME:${TARGET}>")
+        else()
+          set(result "$<TARGET_SONAME_FILE_NAME:${TARGET}>")
+        endif()
     endif()
     set(${DEST} ${result} PARENT_SCOPE)
 endfunction()