diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-09-24 10:28:52 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-09-24 10:28:52 -0500 |
commit | 353debe119c862c310aea4a50f9ace1c6afed2a1 (patch) | |
tree | 9b74ce5db3207f70dbf1976a7d7768afc7d3d354 /CMakeLists.txt | |
parent | Merge pull request #5882 (diff) | |
parent | Add the iwyu target to get information on unused headers (diff) | |
download | monero-353debe119c862c310aea4a50f9ace1c6afed2a1.tar.xz |
Merge pull request #5884
7de6671 Add the iwyu target to get information on unused headers (omartijn)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index beb97bfcf..9f628049b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,9 @@ # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake") include(CheckCCompilerFlag) @@ -999,3 +1002,13 @@ option(INSTALL_VENDORED_LIBUNBOUND "Install libunbound binary built from source CHECK_C_COMPILER_FLAG(-std=c11 HAVE_C11) + +find_package(PythonInterp) +find_program(iwyu_tool_path NAMES iwyu_tool.py iwyu_tool) +if (iwyu_tool_path AND PYTHONINTERP_FOUND) + add_custom_target(iwyu + COMMAND "${PYTHON_EXECUTABLE}" "${iwyu_tool_path}" -p "${CMAKE_BINARY_DIR}" -- --no_fwd_decls + COMMENT "Running include-what-you-use tool" + VERBATIM + ) +endif() |