Skip to content

Commit 3837b42

Browse files
committed
cmake: make sure SDL3's include directory comes first
Include directories of a target come before those of linked targets.
1 parent 1a29df0 commit 3837b42

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ target_compile_definitions(${sdl3_net_target_name} PRIVATE
121121
SDL_BUILD_MINOR_VERSION=${MINOR_VERSION}
122122
SDL_BUILD_MICRO_VERSION=${MICRO_VERSION}
123123
)
124+
# Make sure SDL3's include directory comes first
125+
target_include_directories(${sdl3_net_target_name} PRIVATE $<TARGET_PROPERTY:SDL3::Headers,INTERFACE_INCLUDE_DIRECTORIES>)
124126
target_link_libraries(${sdl3_net_target_name} PUBLIC SDL3::Headers)
125127
if(SDLNET_BUILD_SHARED_LIBS)
126128
target_link_libraries(${sdl3_net_target_name} PRIVATE SDL3::SDL3-shared)

0 commit comments

Comments
 (0)