SDL: cmake: add khronos include directories with PRIVATE visibility

From 9aff68746f02e9bd301ec5075a4211e28e864b95 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 7 May 2024 16:53:23 +0200
Subject: [PATCH] cmake: add khronos include directories with PRIVATE
 visibility

---
 CMakeLists.txt      | 4 ++--
 test/CMakeLists.txt | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06712aeed687d..8166c49663bd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -466,9 +466,9 @@ sdl_include_directories(
 )
 # Note: The clang toolset for Visual Studio does not support the '-idirafter' option.
 if(USE_GCC OR USE_INTELCC OR (USE_CLANG AND NOT MSVC_CLANG))
-  sdl_compile_options(NO_EXPORT PUBLIC "$<BUILD_INTERFACE:-idirafter${SDL3_SOURCE_DIR}/src/video/khronos>")
+  sdl_compile_options(NO_EXPORT PRIVATE "$<BUILD_INTERFACE:-idirafter${SDL3_SOURCE_DIR}/src/video/khronos>")
 else()
-  sdl_include_directories(NO_EXPORT SYSTEM PUBLIC "$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/src/video/khronos>")
+  sdl_include_directories(NO_EXPORT SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/src/video/khronos>")
 endif()
 
 # General source files
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index ae6f5b342fe14..b823af8596741 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -131,6 +131,7 @@ macro(add_sdl_test_executable TARGET)
         add_executable(${TARGET} ${AST_SOURCES} ${EXTRA_SOURCES})
     endif()
     SDL_AddCommonCompilerFlags(${TARGET})
+    target_include_directories(${TARGET} PRIVATE "${SDL3_SOURCE_DIR}/src/video/khronos")
     target_link_libraries(${TARGET} PRIVATE SDL3::SDL3_test SDL3::${sdl_name_component})
     if(NOT AST_NO_C90 AND NOT SDL_CMAKE_PLATFORM MATCHES "^(n3ds|ps2|psp)$")
         set_property(TARGET ${TARGET} PROPERTY C_STANDARD 90)