# SDL\_image: cmake: add -Wl,-framework,ApplicationServices only for macOS (4d1f3)

**URL:** <https://discourse.libsdl.org/t/sdl-image-cmake-add-wl-framework-applicationservices-only-for-macos-4d1f3/55837>\
**Category:** SDL Commits\
**Created:** [December 7, 2024, 12:49am UTC](https://discourse.libsdl.org/t/sdl-image-cmake-add-wl-framework-applicationservices-only-for-macos-4d1f3/55837 "2024-12-07T00:49:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [December 7, 2024, 12:49am UTC](https://discourse.libsdl.org/t/sdl-image-cmake-add-wl-framework-applicationservices-only-for-macos-4d1f3/55837/1 "2024-12-07T00:49:57Z")

</div>

> <https://github.com/libsdl-org/SDL_image/commit/4d1f3575cba37b20f91ae15b5e3b46d9cea52cb6>
>
> Backport of ee91574

```diff
From 4d1f3575cba37b20f91ae15b5e3b46d9cea52cb6 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 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

```
