summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-01-27 11:09:07 -0500
committerBen Boeckel <ben.boeckel@kitware.com>2023-01-27 11:09:07 -0500
commit25f0b4f397255dfb235d285bd391536a1fe8fe8c (patch)
treee7e55f6023b96097d3a7d10bdab697a2f4f346ed /CMakeLists.txt
parent7ac338be9830bdc936b52a4135504ed011418f3c (diff)
downloadcmake-25f0b4f397255dfb235d285bd391536a1fe8fe8c.tar.gz
CMake: add an option to run IWYU in verbose mode
This helps to diagnose places where IWYU asks to include headers for internal stdlib details.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0485b041a1..d11b4cd493 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -313,6 +313,11 @@ if(CMake_RUN_IWYU)
endif()
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
"${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp;-w")
+ option(CMake_IWYU_VERBOSE "Run include-what-you-use in verbose mode" OFF)
+ if (CMake_IWYU_VERBOSE)
+ list(APPEND CMAKE_CXX_INCLUDE_WHAT_YOU_USE
+ -Xiwyu -v7)
+ endif ()
list(APPEND CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${CMake_IWYU_OPTIONS})
endif()