Commit 2fa35757a99ccec7d48ea0bbe3d57ef0d9ce9266

Cameron Gutman 2021-11-24T23:34:45

cmake: Weak link to GameController.framework to handle older OSes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 20a743a..7b60335 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2055,7 +2055,9 @@ elseif(APPLE)
   endif()
   if(SDL_FRAMEWORK_GAMECONTROLLER)
     find_library(GAMECONTROLLER GameController)
-    list(APPEND EXTRA_LIBS ${GAMECONTROLLER})
+    if(GAMECONTROLLER)
+      list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,GameController")
+    endif()
   endif()
   if(SDL_FRAMEWORK_METAL)
     if(IOS OR TVOS)