From 47ce69aa5737409fc3b66fdfcba0953284dbf969 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 13 May 2020 20:28:12 +0800 Subject: [PATCH] cmake: remove cppcheck and iwyu targets these targets are not used by any other targets, and are not integrated with CI. so let's drop them. Signed-off-by: Kefu Chai --- CMakeLists.txt | 2 -- cmake/modules/FindCppCheck.cmake | 28 ---------------------------- cmake/modules/FindIWYU.cmake | 25 ------------------------- 3 files changed, 55 deletions(-) delete mode 100644 cmake/modules/FindCppCheck.cmake delete mode 100644 cmake/modules/FindIWYU.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index fa00d1316bcc..064d3b94f1c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -675,6 +675,4 @@ add_tags(ctags EXCLUDES "*.js" "*.css") add_custom_target(tags DEPENDS ctags) -find_package(CppCheck) -find_package(IWYU) set(VERSION 15.2.0) diff --git a/cmake/modules/FindCppCheck.cmake b/cmake/modules/FindCppCheck.cmake deleted file mode 100644 index 0ee701c0a2aa..000000000000 --- a/cmake/modules/FindCppCheck.cmake +++ /dev/null @@ -1,28 +0,0 @@ -unset(CPPCHECK_BIN CACHE) -find_program(CPPCHECK_BIN cppcheck) - -if(CPPCHECK_BIN) - find_file(PROJECT_FILE compile_commands.json PATH .) - if(NOT PROJECT_FILE) - message(STATUS "Found cppcheck, but no \"compile_commands.json\" file. To enable cppcheck, set CMAKE_EXPORT_COMPILE_COMMANDS to \"ON\" and build again.") - return() - endif() - - include(ProcessorCount) - ProcessorCount(N) - - execute_process(COMMAND cppcheck --version OUTPUT_VARIABLE CPPCHECK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - separate_arguments(CPPCHECK_VERSION) - list(GET CPPCHECK_VERSION 1 VERSION_NUMBER) - if(VERSION_NUMBER VERSION_GREATER_EQUAL 1.88) - set(CPP_STD_VERSION "c++17") - else() - set(CPP_STD_VERSION "c++14") - endif() - - add_custom_target(cppcheck - COMMAND ${CPPCHECK_BIN} --verbose -j${N} --std=${CPP_STD_VERSION} --inline-suppr --project=${PROJECT_FILE} 2> cppcheck.txt | grep done - ) - - message(STATUS "Found cppcheck. To perform static analysis using cppcheck, use: \"make cppcheck\". Results will be stored in \"cppcheck.txt\".") -endif() diff --git a/cmake/modules/FindIWYU.cmake b/cmake/modules/FindIWYU.cmake deleted file mode 100644 index 83bfd415a7ed..000000000000 --- a/cmake/modules/FindIWYU.cmake +++ /dev/null @@ -1,25 +0,0 @@ -unset(IWYU_BIN CACHE) -find_program(IWYU_BIN iwyu_tool.py) - -if(IWYU_BIN) - find_file(PROJECT_FILE compile_commands.json PATH .) - if(NOT PROJECT_FILE) - message(STATUS "Found IWYU, but no \"compile_commands.json\" file. To enable IWYU, set CMAKE_EXPORT_COMPILE_COMMANDS to \"ON\" and build again.") - return() - endif() - - if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - message(STATUS "Found IWYU, but clang++ is not used. To enable IWYU, set CMAKE_C_COMPILER to \"clang\" and CMAKE_CXX_COMPILER to \"clang++\" and build again.") - return() - endif() - - include(ProcessorCount) - ProcessorCount(N) - - add_custom_target(iwyu - COMMAND echo "IWYU is analyzing includes - this may take a while..." - COMMAND ${IWYU_BIN} -j${N} -p . > iwyu.txt - ) - - message(STATUS "Found IWYU. To perform header analysis using IWYU, use: \"make iwyu\". Results will be stored in \"iwyu.txt\".") -endif() -- 2.47.3