SDL: cmake: fix testnative for Macos

From cb076b83ff89a08fb5279922c5518add302f566c Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 28 Mar 2023 03:22:29 +0200
Subject: [PATCH] cmake: fix testnative for Macos

---
 test/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index b0d83f14129a..e679e1c7bfb1 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -179,11 +179,11 @@ if(SDL3_TESTS_SUBPROJECT)
                 testnativecocoa.m
                 testnativex11.c
         )
-        target_compile_definitions(testnative PRIVATE TEST_NATIVE_COCOA)
 
         cmake_push_check_state()
         check_c_compiler_flag(-Wno-error=deprecated-declarations HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS)
         cmake_pop_check_state()
+        target_link_libraries(testnative PRIVATE "-Wl,-framework,Cocoa")
         if(HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS)
             set_property(SOURCE "testnativecocoa.m" APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-error=deprecated-declarations")
         endif()