This is an automated email from the ASF dual-hosted git repository. dongjoon pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/main by this push: new 839c4289d ORC-2009: [C++] Remove unused code for CMake 3.6 and older 839c4289d is described below commit 839c4289de811d7e4cebc9639c40d746cc2e2ae8 Author: Dongjoon Hyun <dongj...@apache.org> AuthorDate: Fri Sep 26 08:32:59 2025 -0700 ORC-2009: [C++] Remove unused code for CMake 3.6 and older ### What changes were proposed in this pull request? This PR aims to remove unused code for `CMake` 3.6 or older versions. Currently, we have 4 instances. ```bash $ git grep CMAKE_VERSION cmake_modules/ThirdpartyToolchain.cmake: if (CMAKE_VERSION VERSION_GREATER "3.7") cmake_modules/ThirdpartyToolchain.cmake: if (CMAKE_VERSION VERSION_GREATER "3.7") cmake_modules/ThirdpartyToolchain.cmake: if (CMAKE_VERSION VERSION_GREATER "3.7") cmake_modules/ThirdpartyToolchain.cmake: if (CMAKE_VERSION VERSION_GREATER "3.7") ``` ### Why are the changes needed? Apache ORC's minimum CMake version is `3.12.0`. So, this code path is inaccessible. https://github.com/apache/orc/blob/7674f4335d2124af5fab178e55a838b03035011e/CMakeLists.txt#L18 ### How was this patch tested? Pass the CIs and check manually like the following. **BEFORE** ```bash $ git grep VERSION_GREATER | wc -l 4 ``` **AFTER** ```bash $ git grep VERSION_GREATER | wc -l 0 ``` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #2415 from dongjoon-hyun/ORC-2009. Authored-by: Dongjoon Hyun <dongj...@apache.org> Signed-off-by: Dongjoon Hyun <dongj...@apache.org> --- cmake_modules/ThirdpartyToolchain.cmake | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake index 37c3311ec..9103ace12 100644 --- a/cmake_modules/ThirdpartyToolchain.cmake +++ b/cmake_modules/ThirdpartyToolchain.cmake @@ -315,12 +315,7 @@ else () set(ZSTD_CMAKE_ARGS ${ZSTD_CMAKE_ARGS} -DCMAKE_POSITION_INDEPENDENT_CODE=ON) endif () - if (CMAKE_VERSION VERSION_GREATER "3.7") - set(ZSTD_CONFIGURE SOURCE_SUBDIR "build/cmake" CMAKE_ARGS ${ZSTD_CMAKE_ARGS}) - else() - set(ZSTD_CONFIGURE CONFIGURE_COMMAND "${THIRDPARTY_CONFIGURE_COMMAND}" ${ZSTD_CMAKE_ARGS} - "${CMAKE_CURRENT_BINARY_DIR}/zstd_ep-prefix/src/zstd_ep/build/cmake") - endif() + set(ZSTD_CONFIGURE SOURCE_SUBDIR "build/cmake" CMAKE_ARGS ${ZSTD_CMAKE_ARGS}) ExternalProject_Add(zstd_ep URL "https://github.com/facebook/zstd/archive/v${ZSTD_VERSION}.tar.gz" @@ -376,12 +371,7 @@ else () set(LZ4_CMAKE_ARGS ${LZ4_CMAKE_ARGS} -DCMAKE_POSITION_INDEPENDENT_CODE=ON) endif () - if (CMAKE_VERSION VERSION_GREATER "3.7") - set(LZ4_CONFIGURE SOURCE_SUBDIR "build/cmake" CMAKE_ARGS ${LZ4_CMAKE_ARGS}) - else() - set(LZ4_CONFIGURE CONFIGURE_COMMAND "${THIRDPARTY_CONFIGURE_COMMAND}" ${LZ4_CMAKE_ARGS} - "${CMAKE_CURRENT_BINARY_DIR}/lz4_ep-prefix/src/lz4_ep/build/cmake") - endif() + set(LZ4_CONFIGURE SOURCE_SUBDIR "build/cmake" CMAKE_ARGS ${LZ4_CMAKE_ARGS}) ExternalProject_Add(lz4_ep URL "https://github.com/lz4/lz4/archive/v${LZ4_VERSION}.tar.gz" @@ -559,12 +549,7 @@ else () set(PROTOC_STATIC_LIB "${PROTOBUF_PREFIX}/lib/${PROTOBUF_STATIC_LIB_PREFIX}protoc${CMAKE_STATIC_LIBRARY_SUFFIX}") set(PROTOBUF_EXECUTABLE "${PROTOBUF_PREFIX}/bin/protoc${CMAKE_EXECUTABLE_SUFFIX}") - if (CMAKE_VERSION VERSION_GREATER "3.7") - set(PROTOBUF_CONFIGURE SOURCE_SUBDIR "cmake" CMAKE_ARGS ${PROTOBUF_CMAKE_ARGS}) - else() - set(PROTOBUF_CONFIGURE CONFIGURE_COMMAND "${THIRDPARTY_CONFIGURE_COMMAND}" ${PROTOBUF_CMAKE_ARGS} - "${CMAKE_CURRENT_BINARY_DIR}/protobuf_ep-prefix/src/protobuf_ep/cmake") - endif() + set(PROTOBUF_CONFIGURE SOURCE_SUBDIR "cmake" CMAKE_ARGS ${PROTOBUF_CMAKE_ARGS}) ExternalProject_Add(protobuf_ep URL "https://github.com/google/protobuf/archive/v${PROTOBUF_VERSION}.tar.gz" @@ -599,12 +584,7 @@ if(BUILD_SPARSEHASH) set(SPARSEHASH_CMAKE_ARGS ${SPARSEHASH_CMAKE_ARGS} -DCMAKE_POSITION_INDEPENDENT_CODE=ON) endif () - if (CMAKE_VERSION VERSION_GREATER "3.7") - set(SPARSEHASH_CONFIGURE SOURCE_SUBDIR "" CMAKE_ARGS ${SPARSEHASH_CMAKE_ARGS}) - else() - set(SPARSEHASH_CONFIGURE CONFIGURE_COMMAND "${THIRDPARTY_CONFIGURE_COMMAND}" ${SPARSEHASH_CMAKE_ARGS} - "${CMAKE_CURRENT_BINARY_DIR}/sparsehash_ep-prefix/src/sparsehash_ep/") - endif() + set(SPARSEHASH_CONFIGURE SOURCE_SUBDIR "" CMAKE_ARGS ${SPARSEHASH_CMAKE_ARGS}) ExternalProject_Add(sparsehash_ep URL "https://github.com/sparsehash/sparsehash-c11/archive/refs/tags/v${SPARSEHASH_VERSION}.tar.gz"