From bdc26e00ad99f4f670df1a65b5e6439d0dfadc87 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Tue, 1 Nov 2016 10:30:37 +0100 Subject: Used IWYU to tidy up some inclusions. --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f241abd..0d88d63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,16 @@ if(DOXYGEN_FOUND) ) endif(DOXYGEN_FOUND) +option(USE_iwyu "Use include-what-you-use to trace unneeded #includes" OFF) +if(USE_iwyu) + find_program(iwyu NAMES include-what-you-use iwyu) + if(NOT iwyu) + message(FATAL_ERROR "Could not find the program include-what-you-use") + else(NOT iwyu) + set(iwyu ${iwyu} -Xiwyu --mapping_file=${CMAKE_SOURCE_DIR}/cmix.imp) + endif(NOT iwyu) +endif(USE_iwyu) + option(use_lto "Enable link time optimalisation" OFF) if(use_lto) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto") -- cgit v1.2.3-70-g09d2