Mark external headers as SYSTEM headers

Among other benefits this ensures that the compiler doesn't emit
warnings on headers in these paths.
This commit is contained in:
Chris Thrasher 2022-02-27 22:37:24 -06:00 committed by Lukas Dürrenberger
parent 7dfc7f0202
commit 2e6c363e64
2 changed files with 4 additions and 3 deletions

View File

@ -247,7 +247,7 @@ if ((NOT BUILD_SHARED_LIBS) AND SFML_OS_MACOSX)
endif()
# Vulkan headers
target_include_directories(sfml-window PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/vulkan")
target_include_directories(sfml-window SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/vulkan")
# find and setup usage for external libraries
if(SFML_OS_LINUX OR SFML_OS_FREEBSD OR SFML_OS_OPENBSD OR SFML_OS_NETBSD)
@ -281,7 +281,7 @@ if(SFML_OS_WINDOWS AND NOT SFML_COMPILER_MSVC)
include(CheckIncludeFile)
check_include_file(dinput.h DINPUT_H_FOUND)
if(NOT DINPUT_H_FOUND)
target_include_directories(sfml-window PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/mingw")
target_include_directories(sfml-window SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/mingw")
endif()
endif()

View File

@ -7,7 +7,8 @@ add_library(sfml-test-main STATIC
TestUtilities/GraphicsUtil.hpp
TestUtilities/GraphicsUtil.cpp
)
target_include_directories(sfml-test-main PUBLIC "${PROJECT_SOURCE_DIR}/extlibs/headers" TestUtilities)
target_include_directories(sfml-test-main SYSTEM PUBLIC "${PROJECT_SOURCE_DIR}/extlibs/headers")
target_include_directories(sfml-test-main PUBLIC TestUtilities)
target_link_libraries(sfml-test-main PUBLIC SFML::System)
# System is always built