From 93d0358ebc5e91428bb686ace66713c0275bb4b6 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Thu, 3 Sep 2020 11:36:02 -0600 Subject: [PATCH] cmake: use static iwyu-extra-map.imp --- cmake/CMakeLists.txt | 9 +-------- cmake/iwyu/iwyu-extra-map.imp | 4 ++++ 2 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 cmake/iwyu/iwyu-extra-map.imp diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 87c70e4483..9fff73f49e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -260,16 +260,9 @@ if(ENABLE_IWYU) if (IWYU_EXE AND IWYU_TOOL) add_custom_target( iwyu - ${IWYU_TOOL} -o clang -p ${CMAKE_CURRENT_BINARY_DIR} -- -Xiwyu --mapping_file=${CMAKE_CURRENT_BINARY_DIR}/iwyu-extra-map.imp + ${IWYU_TOOL} -o clang -p ${CMAKE_CURRENT_BINARY_DIR} -- -Xiwyu --mapping_file=${CMAKE_CURRENT_SOURCE_DIR}/iwyu/iwyu-extra-map.imp COMMENT "Running IWYU") add_dependencies(iwyu lammps) - # generate file with additional mappings - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/iwyu-extra-map.imp "[\n") - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/iwyu-extra-map.imp - " { include: [ \"\", private, \"\", public ] },\n") - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/iwyu-extra-map.imp - " { include: [ \"\", public, \"\", public ] },\n") - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/iwyu-extra-map.imp "]\n") else() message(FATAL_ERROR "To use IWYU you need the include-what-you-use/iwyu executable" "and the iwyu-tool/iwyu_tool script installed in your PATH") diff --git a/cmake/iwyu/iwyu-extra-map.imp b/cmake/iwyu/iwyu-extra-map.imp new file mode 100644 index 0000000000..8985998704 --- /dev/null +++ b/cmake/iwyu/iwyu-extra-map.imp @@ -0,0 +1,4 @@ +[ + { include: [ "", private, "", public ] } + { include: [ "", public, "", public ] } +]