diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index ea15bb70669..a77ed39eac8 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -211,17 +211,6 @@ else() set(MSVC_TOOLCHAIN FALSE) endif() -find_package(ClangTools) -find_package(InferTools) -if("$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}" STREQUAL "1" - OR CLANG_TIDY_FOUND - OR INFER_FOUND) - # Generate a Clang compile_commands.json "compilation database" file for use - # with various development tools, such as Vim's YouCompleteMe plugin. - # See http://clang.llvm.org/docs/JSONCompilationDatabase.html - set(CMAKE_EXPORT_COMPILE_COMMANDS 1) -endif() - # Needed for Gandiva. # Use the first Python installation on PATH, not the newest one set(Python3_FIND_STRATEGY "LOCATION") @@ -649,22 +638,6 @@ if(UNIX) VERBATIM) endif(UNIX) -# -# "make infer" target -# - -if(${INFER_FOUND}) - # runs infer capture - add_custom_target(infer ${BUILD_SUPPORT_DIR}/run-infer.sh ${INFER_BIN} - ${CMAKE_BINARY_DIR}/compile_commands.json 1) - # runs infer analyze - add_custom_target(infer-analyze ${BUILD_SUPPORT_DIR}/run-infer.sh ${INFER_BIN} - ${CMAKE_BINARY_DIR}/compile_commands.json 2) - # runs infer report - add_custom_target(infer-report ${BUILD_SUPPORT_DIR}/run-infer.sh ${INFER_BIN} - ${CMAKE_BINARY_DIR}/compile_commands.json 3) -endif() - # # Link targets # diff --git a/cpp/cmake_modules/FindClangTools.cmake b/cpp/cmake_modules/FindClangTools.cmake deleted file mode 100644 index 1364ccbed81..00000000000 --- a/cpp/cmake_modules/FindClangTools.cmake +++ /dev/null @@ -1,122 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Tries to find the clang-tidy and clang-format modules -# -# Usage of this module as follows: -# -# find_package(ClangTools) -# -# Variables used by this module which can change the default behaviour and need -# to be set before calling find_package: -# -# CLANG_FORMAT_VERSION - -# The version of clang-format to find. If this is not specified, clang-format -# will not be searched for. -# -# ClangTools_PATH - -# When set, this path is inspected in addition to standard library binary locations -# to find clang-tidy and clang-format -# -# This module defines -# CLANG_TIDY_BIN, The path to the clang tidy binary -# CLANG_TIDY_FOUND, Whether clang tidy was found -# CLANG_FORMAT_BIN, The path to the clang format binary -# CLANG_FORMAT_FOUND, Whether clang format was found - -set(CLANG_TOOLS_SEARCH_PATHS - ${ClangTools_PATH} - $ENV{CLANG_TOOLS_PATH} - /usr/local/bin - /usr/bin - "C:/Program Files/LLVM/bin" # Windows, non-conda - "$ENV{CONDA_PREFIX}/Library/bin" # Windows, conda - "$ENV{CONDA_PREFIX}/bin") # Unix, conda -if(APPLE) - find_program(BREW brew) - if(BREW) - execute_process(COMMAND ${BREW} --prefix "llvm@${ARROW_CLANG_TOOLS_VERSION_MAJOR}" - OUTPUT_VARIABLE CLANG_TOOLS_BREW_PREFIX - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(NOT CLANG_TOOLS_BREW_PREFIX) - execute_process(COMMAND ${BREW} --prefix llvm - OUTPUT_VARIABLE CLANG_TOOLS_BREW_PREFIX - OUTPUT_STRIP_TRAILING_WHITESPACE) - endif() - if(CLANG_TOOLS_BREW_PREFIX) - list(APPEND CLANG_TOOLS_SEARCH_PATHS "${CLANG_TOOLS_BREW_PREFIX}/bin") - endif() - endif() -endif() - -function(FIND_CLANG_TOOL NAME OUTPUT VERSION_CHECK_PATTERN) - unset(CLANG_TOOL_BIN CACHE) - find_program(CLANG_TOOL_BIN - NAMES ${NAME}-${ARROW_CLANG_TOOLS_VERSION} - ${NAME}-${ARROW_CLANG_TOOLS_VERSION_MAJOR} - PATHS ${CLANG_TOOLS_SEARCH_PATHS} - NO_DEFAULT_PATH) - if(NOT CLANG_TOOL_BIN) - # try searching for non-versioned tool and check the version - find_program(CLANG_TOOL_BIN - NAMES ${NAME} - PATHS ${CLANG_TOOLS_SEARCH_PATHS} - NO_DEFAULT_PATH) - if(CLANG_TOOL_BIN) - unset(CLANG_TOOL_VERSION_MESSAGE) - execute_process(COMMAND ${CLANG_TOOL_BIN} "-version" - OUTPUT_VARIABLE CLANG_TOOL_VERSION_MESSAGE - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(NOT (${CLANG_TOOL_VERSION_MESSAGE} MATCHES ${VERSION_CHECK_PATTERN})) - message(STATUS "${NAME} found, but version did not match \"${VERSION_CHECK_PATTERN}\"" - ) - set(CLANG_TOOL_BIN "CLANG_TOOL_BIN-NOTFOUND") - endif() - endif() - endif() - if(CLANG_TOOL_BIN) - set(${OUTPUT} - ${CLANG_TOOL_BIN} - PARENT_SCOPE) - else() - set(${OUTPUT} - "${OUTPUT}-NOTFOUND" - PARENT_SCOPE) - endif() -endfunction() - -string(REGEX REPLACE "\\." "\\\\." ARROW_CLANG_TOOLS_VERSION_ESCAPED - "${ARROW_CLANG_TOOLS_VERSION}") - -find_clang_tool(clang-tidy CLANG_TIDY_BIN - "LLVM version ${ARROW_CLANG_TOOLS_VERSION_ESCAPED}") -if(CLANG_TIDY_BIN) - set(CLANG_TIDY_FOUND 1) - message(STATUS "clang-tidy found at ${CLANG_TIDY_BIN}") -else() - set(CLANG_TIDY_FOUND 0) - message(STATUS "clang-tidy ${ARROW_CLANG_TOOLS_VERSION} not found") -endif() - -find_clang_tool(clang-format CLANG_FORMAT_BIN - "clang-format version ${ARROW_CLANG_TOOLS_VERSION_ESCAPED}") -if(CLANG_FORMAT_BIN) - set(CLANG_FORMAT_FOUND 1) - message(STATUS "clang-format found at ${CLANG_FORMAT_BIN}") -else() - set(CLANG_FORMAT_FOUND 0) - message(STATUS "clang-format ${ARROW_CLANG_TOOLS_VERSION} not found") -endif() - -find_package_handle_standard_args(ClangTools REQUIRED_VARS CLANG_FORMAT_BIN - CLANG_TIDY_BIN) diff --git a/cpp/cmake_modules/FindInferTools.cmake b/cpp/cmake_modules/FindInferTools.cmake deleted file mode 100644 index c4b65653ae9..00000000000 --- a/cpp/cmake_modules/FindInferTools.cmake +++ /dev/null @@ -1,47 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Tries to find the infer module -# -# Usage of this module as follows: -# -# find_package(InferTools) -# -# Variables used by this module, they can change the default behaviour and need -# to be set before calling find_package: -# -# InferTools_PATH - -# When set, this path is inspected instead of standard library binary locations -# to find infer -# -# This module defines -# INFER_BIN, The path to the infer binary -# INFER_FOUND, Whether infer was found - -find_program(INFER_BIN - NAMES infer - PATHS ${InferTools_PATH} - $ENV{INFER_TOOLS_PATH} - /usr/local/bin - /usr/bin - /usr/local/homebrew/bin - /opt/local/bin - NO_DEFAULT_PATH) - -if("${INFER_BIN}" STREQUAL "INFER_BIN-NOTFOUND") - set(INFER_FOUND 0) - message(STATUS "infer not found") -else() - set(INFER_FOUND 1) - message(STATUS "infer found at ${INFER_BIN}") -endif()