sdl12-compat: Minor tweaks for macOS in CMakeLists.txt

From 87ca01001762351a5a0f34eb9f86d2b6319176a2 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Mon, 31 May 2021 20:04:59 -0400
Subject: [PATCH] Minor tweaks for macOS in CMakeLists.txt

The X11 stuff needs to go in our replacement headers for this platform,
assuming people on macOS don't have (and don't want) Xquartz installed.
s
---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7dfaced..9aa894c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,7 @@ if(APPLE)
   # the following matches SDL-1.2 Xcode project file
   set(DYLIB_COMPAT_VERSION 1.0.0)
   set(DYLIB_CURRENT_VERSION 12.50.0)
+  include_directories("/opt/X11/include")  # hack.
 endif()
 if(WIN32)
   set(WIN32_SRCS "src/version.rc")
@@ -130,7 +131,8 @@ if(SDL12TESTS)
     test_program(torturethread "test/torturethread.c")
 
     if(APPLE)
-        target_link_libraries(testgl PRIVATE "-framework OpenGL")
+        target_link_libraries(testgl "-framework OpenGL")
+        set_target_properties(testgl PROPERTIES COMPILE_DEFINITIONS "GL_SILENCE_DEPRECATION=1")
     else()
         target_link_libraries(testgl "GL")
     endif()