Remove SYSTEM scope from transitive includes. (#16018)
Warnings should be fixed or handled as needed, not just by disabling
them for arbitrary portions of the codebase.
This was originally added to match Bazel, but Bazel builds are
undesirably more permissive because of it. This makes the CMake build
more correct.
We add an explicit SYSTEM_INCLUDES which preserves the old behavior and
use it for Tracy+related headers, which include things that are not
warning clean. Everything else is fine (after some of the newly
uncovered warnings were fixed).
Fixes #16017.
diff --git a/build_tools/cmake/flatbuffer_c_library.cmake b/build_tools/cmake/flatbuffer_c_library.cmake
index 0f87a89..826d9ee 100644
--- a/build_tools/cmake/flatbuffer_c_library.cmake
+++ b/build_tools/cmake/flatbuffer_c_library.cmake
@@ -114,7 +114,7 @@
add_library(${_NAME} INTERFACE)
add_dependencies(${_NAME} ${_GEN_TARGET})
- target_include_directories(${_NAME} SYSTEM
+ target_include_directories(${_NAME}
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)