From c4d2d2373cbab9bbc7ef26c2630be9f4a923986a Mon Sep 17 00:00:00 2001 From: Anonymous Maarten 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 472000585..b4dd2b1eb 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