From 4d1f3575cba37b20f91ae15b5e3b46d9cea52cb6 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 796911d6..0d86d261 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -331,7 +331,9 @@ set(SDL2IMAGE_IMAGEIO_ENABLED FALSE) if(APPLE) if(SDL2IMAGE_BACKEND_IMAGEIO) set(SDL2IMAGE_IMAGEIO_ENABLED TRUE) - 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