SDL: Only add the UniformTypeIdentifiers framework if we're building the dialog subsystem

From c10a3df55238f3c4eebace29c26f1a9a8f8e54fb Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 1 Apr 2024 14:13:31 -0700
Subject: [PATCH] Only add the UniformTypeIdentifiers framework if we're
 building the dialog subsystem

This framework isn't available on older SDKs
---
 CMakeLists.txt | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e7315be9f1af..37d2bd6d9fbc9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2425,9 +2425,6 @@ elseif(APPLE)
       sdl_link_dependency(core_haptics LINK_OPTIONS "-Wl,-framework,CoreHaptics")
     endif()
   endif()
-  if(SDL_FRAMEWORK_UTTYPES)
-	sdl_link_dependency(uniformtypeidentifiers LINK_OPTIONS "-Wl,-weak_framework,UniformTypeIdentifiers")
-  endif()
 
   CheckPTHREAD()
 
@@ -2889,6 +2886,7 @@ if (SDL_DIALOG)
     set(HAVE_SDL_DIALOG TRUE)
   elseif(APPLE)
     sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/cocoa/SDL_cocoadialog.m)
+    sdl_link_dependency(uniformtypeidentifiers LINK_OPTIONS "-Wl,-weak_framework,UniformTypeIdentifiers")
     set(HAVE_SDL_DIALOG TRUE)
   endif()
 endif()