summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--Utilities/IWYU/mapping.imp2
2 files changed, 6 insertions, 1 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()
diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp
index b0ed911bb0..0ba2f519e9 100644
--- a/Utilities/IWYU/mapping.imp
+++ b/Utilities/IWYU/mapping.imp
@@ -76,7 +76,7 @@
# __decay_and_strip is used internally in the C++11 standard library.
# IWYU does not classify it as internal and suggests to add <type_traits>.
# To ignore it, we simply map it to a file that is included anyway.
- # Use '-Xiwyu -v7' to see the fully qualified names that need this.
+ # Use 'CMake_IWYU_VERBOSE' to see the fully qualified names that need this.
# TODO: Can this be simplified with an @-expression?
#{ symbol: [ "@std::__decay_and_strip<.*>::__type", private, "\"cmConfigure.h\"", public ] },
{ symbol: [ "std::__decay_and_strip<bool>::__type", private, "\"cmConfigure.h\"", public ] },