summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-05-25 12:43:26 -0400
committerBrad King <brad.king@kitware.com>2018-05-25 12:46:19 -0400
commit281f59536f8c16f9eacf175f8316a82f09629203 (patch)
treeeaa2684ec17acca79e1b46a69b409c962a4e830f /CMakeLists.txt
parente6a32f0525d936990ee6df5441d510fa6255f696 (diff)
downloadcmake-281f59536f8c16f9eacf175f8316a82f09629203.tar.gz
IWYU: Define a macro to tell code it is preprocessing for iwyu
There are some cases where satisfying IWYU breaks compilation, such as forward-declaring the `std::hash<>` template with C++ standard libraries that use an inline namespace inside `std`. Define a macro during include-what-you-use preprocessing so that code can adapt.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ee67cbc15..e20d770242 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -285,7 +285,7 @@ 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")
+ "${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp;-w;-DCMAKE_IWYU")
endif()