From 2e6c363e644b430fd137a7dbed9836f965796610 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sun, 27 Feb 2022 22:37:24 -0600 Subject: [PATCH] Mark external headers as SYSTEM headers Among other benefits this ensures that the compiler doesn't emit warnings on headers in these paths. --- src/SFML/Window/CMakeLists.txt | 4 ++-- test/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SFML/Window/CMakeLists.txt b/src/SFML/Window/CMakeLists.txt index c39a3e1dd..d37dbb8de 100644 --- a/src/SFML/Window/CMakeLists.txt +++ b/src/SFML/Window/CMakeLists.txt @@ -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() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d8a5ba291..a67616ce8 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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