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

wgtmac pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new f8eca4fa build: avoid duplicate libraries in the C++20 compatibility 
test (#1015)
f8eca4fa is described below

commit f8eca4faae2c8fcbc6484fbfa476254b851cc2d7
Author: Gang Wu <[email protected]>
AuthorDate: Thu Oct 15 14:12:20 2026 +0800

    build: avoid duplicate libraries in the C++20 compatibility test (#1015)
---
 src/iceberg/test/CMakeLists.txt | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt
index 3a38db35..ac978c2c 100644
--- a/src/iceberg/test/CMakeLists.txt
+++ b/src/iceberg/test/CMakeLists.txt
@@ -377,6 +377,16 @@ if(ICEBERG_BUILD_HIVE)
 endif()
 
 if(ICEBERG_CXX20_COMPAT)
+  # De-duplicate libraries only when the linker supports it, without changing
+  # policies for other targets or requiring a newer CMake version.
+  cmake_policy(PUSH)
+  if(POLICY CMP0156)
+    cmake_policy(SET CMP0156 NEW)
+  endif()
+  if(POLICY CMP0179)
+    cmake_policy(SET CMP0179 NEW)
+  endif()
+
   # Compile the public headers as a C++20 consumer. The list lives in
   # iceberg/cpp20_compatibility_internal.h, generated by
   # ci/scripts/generate_public_headers.py; headers of optional components are 
enabled
@@ -428,4 +438,5 @@ if(ICEBERG_CXX20_COMPAT)
     target_compile_options(cpp20_compatibility_test PRIVATE /bigobj 
/Zc:preprocessor)
   endif()
   add_test(NAME cpp20_compatibility_test COMMAND cpp20_compatibility_test)
+  cmake_policy(POP)
 endif()

Reply via email to