summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Evan Cox <evanacox00@gmail.com>2022-08-11 14:55:04 -0400
committerGravatar Evan Cox <evanacox00@gmail.com>2022-08-11 14:55:04 -0400
commit6f6886156d986d83e33f97578bd3eb66b36fb40a (patch)
tree18777e01039125298439ee7634e059fac04c9288 /CMakeLists.txt
parent697acabc5b7e28c51f7ab8d2f43d4ef4fed77f8d (diff)
add new CMake option `ABSL_USE_SYSTEM_INCLUDES`
When using Abseil as a dependency with CMake, files that include Abseil headers and have incompatible warning settings can emit compiler warnings. CMake allows you to mark include directories as `SYSTEM` includes, which causes compilers to ignore warnings from those headers. This adds the new option `ABSL_USE_SYSTEM_INCLUDES`, which makes Abseil's include directories be marked with `SYSTEM`.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 10acf3b7..6f96c28e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,6 +70,10 @@ if((${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.8) AND (NOT ABSL_PROPAGATE_CXX_STD)
message(WARNING "A future Abseil release will default ABSL_PROPAGATE_CXX_STD to ON for CMake 3.8 and up. We recommend enabling this option to ensure your project still builds correctly.")
endif()
+option(ABSL_USE_SYSTEM_INCLUDES
+ "Mark C++ include directories with `SYSTEM` to prevent warnings from headers when using Abseil with incompatible warning flags"
+ OFF)
+
list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/CMake
${CMAKE_CURRENT_LIST_DIR}/absl/copts