summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-30 15:19:20 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-01-30 15:19:31 (GMT)
commit09cb6c48e27a3696796cfbb89822e468de0e491f (patch)
tree8b785271281200b4225cd758d2a2c6642c5cb1e5
parent28ef53b55b658b4bf55b92dc5a415b1afaf84b9a (diff)
parentbf3425c3d26c93c890ae732de5cf4493714dffa0 (diff)
downloadCMake-09cb6c48e27a3696796cfbb89822e468de0e491f.zip
CMake-09cb6c48e27a3696796cfbb89822e468de0e491f.tar.gz
CMake-09cb6c48e27a3696796cfbb89822e468de0e491f.tar.bz2
Merge topic 'iwyu-better-ci-logs'
bf3425c3d2 ci: add a comment to run IWYU in verbose mode 25f0b4f397 CMake: add an option to run IWYU in verbose mode Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8130
-rw-r--r--.gitlab/ci/configure_debian10_iwyu.cmake2
-rw-r--r--CMakeLists.txt5
-rw-r--r--Utilities/IWYU/mapping.imp2
3 files changed, 8 insertions, 1 deletions
diff --git a/.gitlab/ci/configure_debian10_iwyu.cmake b/.gitlab/ci/configure_debian10_iwyu.cmake
index 1daa581..abe750d 100644
--- a/.gitlab/ci/configure_debian10_iwyu.cmake
+++ b/.gitlab/ci/configure_debian10_iwyu.cmake
@@ -1,4 +1,6 @@
set(CMake_RUN_IWYU ON CACHE BOOL "")
+# Uncomment to diagnose IWYU problems as needed.
+#set(CMake_IWYU_VERBOSE ON CACHE BOOL "")
set(IWYU_COMMAND "/usr/bin/include-what-you-use-6.0" CACHE FILEPATH "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0485b04..d11b4cd 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 b0ed911..0ba2f51 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 ] },