From 25f0b4f397255dfb235d285bd391536a1fe8fe8c Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 27 Jan 2023 11:09:07 -0500 Subject: 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. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'CMakeLists.txt') 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() -- cgit v1.2.1