浏览代码

cmake: Add SDL include path when building tests

The tests can't find any of the SDL includes otherwise
Cameron Gutman 3 年之前
父节点
当前提交
16845eef29
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      CMakeLists.txt

+ 2 - 0
CMakeLists.txt

@@ -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)