Is it possible to treat include-what-you-use warnings as errors using cmake?
I am playing around with include-what-you-use trying to integrate it into our cmake build process. The desired behaviour is to stop the build process when include-what-you-use generates a report, then print a warning. Currently, the build continues.
The tool is integrated to the cmake build process thanks to:
find_program(IWYU NAMES include-what-you-use)
if(IWYU)
message(STATUS "Using include-what-you-use")
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU})
endif()
I also add the Werror flag to my cmake target.