SDL_image: cmake: add -Wl,-framework,ApplicationServices only for macOS (c4d2d)

From c4d2d2373cbab9bbc7ef26c2630be9f4a923986a Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sat, 7 Dec 2024 01:49:26 +0100
Subject: [PATCH] cmake: add -Wl,-framework,ApplicationServices only for macOS

Backport of ee91574
---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47200058..b4dd2b1e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -320,7 +320,9 @@ endif()
 
 if(APPLE)
     if(SDL2IMAGE_BACKEND_IMAGEIO)
-        target_link_libraries(SDL2_image PRIVATE -Wl,-framework,ApplicationServices)
+        if(CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*")
+            target_link_libraries(SDL2_image PRIVATE -Wl,-framework,ApplicationServices)
+        endif()
         target_link_libraries(SDL2_image PRIVATE objc)
         target_sources(SDL2_image PRIVATE
             src/IMG_ImageIO.m