cmake: Add SDL include path when building tests

The tests can't find any of the SDL includes otherwise
This commit is contained in:
Cameron Gutman 2021-10-30 12:06:58 -05:00 committed by Sam Lantinga
parent 7e8469d196
commit 16845eef29
1 changed files with 2 additions and 0 deletions

View File

@ -2738,6 +2738,8 @@ endif()
##### Tests #####
if(SDL_TEST)
include_directories(BEFORE "${SDL2_BINARY_DIR}/include")
include_directories(AFTER "${SDL2_SOURCE_DIR}/include")
file(GLOB TEST_SOURCES ${SDL2_SOURCE_DIR}/src/test/*.c)
add_library(SDL2_test STATIC ${TEST_SOURCES})
add_subdirectory(test)