diff options
author | Brad King <brad.king@kitware.com> | 2018-05-25 16:43:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-05-25 16:46:19 (GMT) |
commit | 281f59536f8c16f9eacf175f8316a82f09629203 (patch) | |
tree | eaa2684ec17acca79e1b46a69b409c962a4e830f /CMakeLists.txt | |
parent | e6a32f0525d936990ee6df5441d510fa6255f696 (diff) | |
download | CMake-281f59536f8c16f9eacf175f8316a82f09629203.zip CMake-281f59536f8c16f9eacf175f8316a82f09629203.tar.gz CMake-281f59536f8c16f9eacf175f8316a82f09629203.tar.bz2 |
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.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ee67cb..e20d770 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() |