From b3936b9f0d0a899480741f2026c0349bf876c210 Mon Sep 17 00:00:00 2001 From: Francis <455954986@qq.com> Date: Wed, 23 Aug 2023 04:36:24 +0800 Subject: [PATCH] GH-37299: [C++] Fix clang-format version mismatch error with Homebrew's clang-format (#37300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Rationale for this change On my mac system, the clang-format version information is: ``` ➜ ~ clang-format -version Homebrew clang-format version 16.0.4 ``` This isn't matched by the current clang-format regex in the CMake setup: ```cmake find_clang_tool(clang-format CLANG_FORMAT_BIN "^clang-format version ${ARROW_CLANG_TOOLS_VERSION_ESCAPED}") ``` ### What changes are included in this PR? Make regex more lenient to accomodate the Homebrew clang-format version string. ### Are these changes tested? no ### Are there any user-facing changes? no * Closes: #37299 Authored-by: light-city <455954986@qq.com> Signed-off-by: Sutou Kouhei --- cpp/cmake_modules/FindClangTools.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/FindClangTools.cmake b/cpp/cmake_modules/FindClangTools.cmake index a00ff2c939db9..90df60bf541d4 100644 --- a/cpp/cmake_modules/FindClangTools.cmake +++ b/cpp/cmake_modules/FindClangTools.cmake @@ -108,7 +108,7 @@ else() endif() find_clang_tool(clang-format CLANG_FORMAT_BIN - "^clang-format version ${ARROW_CLANG_TOOLS_VERSION_ESCAPED}") + "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}")