This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new ddd2ee7be ORC-1896: Add `CMAKE_POLICY_VERSION_MINIMUM=3.12` to 
`ThirdpartyToolchain.cmake`
ddd2ee7be is described below

commit ddd2ee7be23db716b6c70d24c98e7a80dddad2ca
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Fri Sep 12 15:10:53 2025 -0700

    ORC-1896: Add `CMAKE_POLICY_VERSION_MINIMUM=3.12` to 
`ThirdpartyToolchain.cmake`
    
    ### What changes were proposed in this pull request?
    
    This PR aims to add `CMAKE_POLICY_VERSION_MINIMUM=3.12` explicitly to 
`ThirdpartyToolchain.cmake` for Apache ORC 2.0.x.
    
    ### Why are the changes needed?
    
    The minimum requirement of CMake is `3.12.0` in Apache ORC 2.0.x.
    
    
https://github.com/apache/orc/blob/42a9dbacc6acfcfddbb378a12bdc7c03e38590c8/CMakeLists.txt#L18
    
    This will resolve the `branch-2.0` CI failure.
    
    - https://github.com/apache/orc/actions/runs/17686769349/job/50273163640
    
    ```
    CMake Error at 
/Users/runner/work/orc/orc/build/protobuf_ep-prefix/src/protobuf_ep-stamp/protobuf_ep-configure-RELWITHDEBINFO.cmake:49
 (message):
      Command failed: 1
    
       '/opt/homebrew/bin/cmake' 
'-DCMAKE_INSTALL_PREFIX=/Users/runner/work/orc/orc/build/c++/libs/thirdparty/protobuf_ep-install'
 '-DCMAKE_INSTALL_LIBDIR=lib' '-DBUILD_SHARED_LIBS=OFF' 
'-Dprotobuf_BUILD_TESTS=OFF' '-GUnix Makefiles' '-S' 
'/Users/runner/work/orc/orc/build/protobuf_ep-prefix/src/protobuf_ep/cmake' 
'-B' '/Users/runner/work/orc/orc/build/protobuf_ep-prefix/src/protobuf_ep-build'
    
      See also
    
        
/Users/runner/work/orc/orc/build/protobuf_ep-prefix/src/protobuf_ep-stamp/protobuf_ep-configure-*.log
    
    make[2]: *** 
[protobuf_ep-prefix/src/protobuf_ep-stamp/protobuf_ep-configure] Error 1
    make[1]: *** [CMakeFiles/protobuf_ep.dir/all] Error 2
    make: *** [all] Error 2
    ```
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #2398 from dongjoon-hyun/ORC-1896-2.0.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 cmake_modules/ThirdpartyToolchain.cmake | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/cmake_modules/ThirdpartyToolchain.cmake 
b/cmake_modules/ThirdpartyToolchain.cmake
index 06f7d1351..80f93703d 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -107,7 +107,7 @@ else ()
 
   ExternalProject_Add (snappy_ep
     URL "https://github.com/google/snappy/archive/${SNAPPY_VERSION}.tar.gz";
-    CMAKE_ARGS ${SNAPPY_CMAKE_ARGS} -DSNAPPY_BUILD_TESTS=OFF
+    CMAKE_ARGS ${SNAPPY_CMAKE_ARGS} -DSNAPPY_BUILD_TESTS=OFF 
-DCMAKE_POLICY_VERSION_MINIMUM=3.12
     ${THIRDPARTY_LOG_OPTIONS}
     BUILD_BYPRODUCTS "${SNAPPY_STATIC_LIB}")
 
@@ -165,7 +165,7 @@ else ()
 
   ExternalProject_Add (zlib_ep
     URL "https://zlib.net/fossils/zlib-${ZLIB_VERSION}.tar.gz";
-    CMAKE_ARGS ${ZLIB_CMAKE_ARGS}
+    CMAKE_ARGS ${ZLIB_CMAKE_ARGS} -DCMAKE_POLICY_VERSION_MINIMUM=3.12
     ${THIRDPARTY_LOG_OPTIONS}
     BUILD_BYPRODUCTS "${ZLIB_STATIC_LIB}")
 
@@ -211,6 +211,7 @@ else ()
   endif ()
   set(ZSTD_STATIC_LIB 
"${ZSTD_HOME}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${ZSTD_STATIC_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}")
   set(ZSTD_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${ZSTD_HOME}
+          -DCMAKE_POLICY_VERSION_MINIMUM=3.12
           -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=lib)
 
   if (BUILD_POSITION_INDEPENDENT_LIB)
@@ -383,7 +384,7 @@ if (BUILD_CPP_TESTS)
       BUILD_IN_SOURCE 1
       URL ${GTEST_SRC_URL}
       ${THIRDPARTY_LOG_OPTIONS}
-      CMAKE_ARGS ${GTEST_CMAKE_ARGS}
+      CMAKE_ARGS ${GTEST_CMAKE_ARGS} -DCMAKE_POLICY_VERSION_MINIMUM=3.12
       BUILD_BYPRODUCTS "${GMOCK_STATIC_LIB}" "${GTEST_STATIC_LIB}")
 
     set(GMOCK_LIBRARY ${GMOCK_STATIC_LIB})
@@ -429,6 +430,7 @@ else ()
   set(PROTOBUF_INCLUDE_DIR "${PROTOBUF_PREFIX}/include")
   set(PROTOBUF_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROTOBUF_PREFIX}
                           -DCMAKE_INSTALL_LIBDIR=lib
+                          -DCMAKE_POLICY_VERSION_MINIMUM=3.12
                           -DBUILD_SHARED_LIBS=OFF
                           -Dprotobuf_BUILD_TESTS=OFF)
 

Reply via email to