mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 21:59:54 -06:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user