summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-08-07 08:18:25 -0400
committerBrad King <brad.king@kitware.com>2018-08-07 12:04:58 -0400
commitaefb8559dca283b81d20a3f40afc8f39e6161ecb (patch)
treee77c6db11f97208b77b9d624e0aadf7e3995502d /CMakeLists.txt
parent276d3c7afe45f26232cf1e9664ad34037d28a52a (diff)
downloadcmake-aefb8559dca283b81d20a3f40afc8f39e6161ecb.tar.gz
IWYU: Fix workaround mapping for std::hash
It is provided by `functional`, not `utility`. Fix the mapping added by commit 276d3c7afe (IWYU: Add workaround mapping for std::hash, 2018-07-31). Also generalize the workaround from commit v3.12.0-rc1~39^2~1 (IWYU: Define a macro to tell code it is preprocessing for iwyu, 2018-05-25) to allow local builds to configure specific flags. This is needed because iwyu behaves differently in different environments.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e20d770242..1fcd8f857b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -285,7 +285,8 @@ if(CMake_RUN_IWYU)
message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!")
endif()
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
- "${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp;-w;-DCMAKE_IWYU")
+ "${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp;-w")
+ list(APPEND CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${CMake_IWYU_OPTIONS})
endif()