From 820733414fe44c50aeb45703db14e940344aa30c Mon Sep 17 00:00:00 2001 From: Zehua Zou <41586196+HuaHuaY@users.noreply.github.com> Date: Wed, 26 Nov 2025 17:08:34 +0800 Subject: [PATCH] fix macos ci warning ignore duplicate libraries --- src/iceberg/test/CMakeLists.txt | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index f0c6027e7..25a03932d 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -164,8 +164,28 @@ if(ICEBERG_BUILD_BUNDLE) endif() if(ICEBERG_BUILD_REST) - add_iceberg_test(rest_catalog_test SOURCES rest_catalog_test.cc - rest_json_internal_test.cc) - target_link_libraries(rest_catalog_test PRIVATE iceberg_rest_static) + function(add_rest_iceberg_test test_name) + set(options USE_BUNDLE) + set(oneValueArgs) + set(multiValueArgs SOURCES) + cmake_parse_arguments(ARG + "${options}" + "${oneValueArgs}" + "${multiValueArgs}" + ${ARGN}) + + add_executable(${test_name}) + target_include_directories(${test_name} PRIVATE "${CMAKE_BINARY_DIR}/iceberg/test/") + + target_sources(${test_name} PRIVATE ${ARG_SOURCES}) + + target_link_libraries(${test_name} PRIVATE GTest::gtest_main GTest::gmock + iceberg_rest_static) + + add_test(NAME ${test_name} COMMAND ${test_name}) + endfunction() + + add_rest_iceberg_test(rest_catalog_test SOURCES rest_catalog_test.cc + rest_json_internal_test.cc) target_include_directories(rest_catalog_test PRIVATE ${cpp-httplib_SOURCE_DIR}) endif()