SDL_mixer: cmake: make sure SDL3's include directory comes first

From 86c6b096f864b8eaed8ba1c58eab1ce716df934f Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sun, 26 Oct 2025 20:54:50 +0100
Subject: [PATCH] cmake: make sure SDL3's include directory comes first

Include directories of a target come before those of linked targets.
---
 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b72dbcbd..92210875 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,6 +249,8 @@ target_compile_definitions(${sdl3_mixer_target_name} PRIVATE
     SDL_BUILD_MINOR_VERSION=${MINOR_VERSION}
     SDL_BUILD_MICRO_VERSION=${MICRO_VERSION}
 )
+# Make sure SDL3's include directory comes first
+target_include_directories(${sdl3_mixer_target_name} PRIVATE $<TARGET_PROPERTY:SDL3::Headers,INTERFACE_INCLUDE_DIRECTORIES>)
 target_link_libraries(${sdl3_mixer_target_name} PUBLIC SDL3::Headers)
 if(SDLMIXER_BUILD_SHARED_LIBS)
     target_link_libraries(${sdl3_mixer_target_name} PRIVATE SDL3::SDL3-shared)