Merge pull request #66 from junghans/include-cleanup
cmake: use static iwyu-extra-map.imp
This commit is contained in:
@ -260,16 +260,9 @@ if(ENABLE_IWYU)
|
|||||||
if (IWYU_EXE AND IWYU_TOOL)
|
if (IWYU_EXE AND IWYU_TOOL)
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
iwyu
|
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")
|
COMMENT "Running IWYU")
|
||||||
add_dependencies(iwyu lammps)
|
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: [ \"<bits/types/struct_rusage.h>\", private, \"<sys/resource.h>\", public ] },\n")
|
|
||||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/iwyu-extra-map.imp
|
|
||||||
" { include: [ \"<bits/exception.h>\", public, \"<exception>\", public ] },\n")
|
|
||||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/iwyu-extra-map.imp "]\n")
|
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "To use IWYU you need the include-what-you-use/iwyu executable"
|
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")
|
"and the iwyu-tool/iwyu_tool script installed in your PATH")
|
||||||
|
|||||||
4
cmake/iwyu/iwyu-extra-map.imp
Normal file
4
cmake/iwyu/iwyu-extra-map.imp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[
|
||||||
|
{ include: [ "<bits/types/struct_rusage.h>", private, "<sys/resource.h>", public ] }
|
||||||
|
{ include: [ "<bits/exception.h>", public, "<exception>", public ] }
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user