build: move GTest and Google Benchmark setup into IcebergThirdpartyToolchain#836
Merged
wgtmac merged 1 commit intoJul 20, 2026
Merged
Conversation
…olchain Move the GoogleTest and Google Benchmark FetchContent setup from the test and benchmark subdirectories into cmake_modules/IcebergThirdpartyToolchain.cmake, so all third-party dependency resolution stays in one place. Add resolve_gtest_dependency() and resolve_benchmark_dependency(), gated by ICEBERG_BUILD_TESTS and ICEBERG_BUILD_BENCHMARKS. Version pins are unchanged and only CMake is affected. Fixes apache#829.
There was a problem hiding this comment.
Pull request overview
This PR centralizes GoogleTest and Google Benchmark dependency resolution in cmake_modules/IcebergThirdpartyToolchain.cmake, aligning test/benchmark third-party setup with the rest of the project’s CMake dependency management (per #829 / discussion from #825).
Changes:
- Moved GoogleTest
FetchContentconfiguration out ofsrc/iceberg/test/CMakeLists.txtintoIcebergThirdpartyToolchain.cmakeviaresolve_gtest_dependency(). - Moved Google Benchmark
FetchContentconfiguration out ofsrc/iceberg/benchmark/CMakeLists.txtintoIcebergThirdpartyToolchain.cmakeviaresolve_benchmark_dependency(). - Added gating so these build-only dependencies are only resolved when
ICEBERG_BUILD_TESTS/ICEBERG_BUILD_BENCHMARKSare enabled.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/iceberg/test/CMakeLists.txt |
Removes local GTest FetchContent setup; relies on toolchain resolver. |
src/iceberg/benchmark/CMakeLists.txt |
Removes local benchmark FetchContent setup; relies on toolchain resolver. |
cmake_modules/IcebergThirdpartyToolchain.cmake |
Adds resolve_gtest_dependency() / resolve_benchmark_dependency() and conditionally invokes them based on build options. |
wgtmac
approved these changes
Jul 20, 2026
Contributor
Author
|
Thank you @wgtmac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #829. The GoogleTest and Google Benchmark FetchContent setup lived in
src/iceberg/test/CMakeLists.txtandsrc/iceberg/benchmark/CMakeLists.txt, apart from the other third-party dependencies. This follows the review discussion on #825, which suggested keeping dependency resolution in one place.How
resolve_gtest_dependency()andresolve_benchmark_dependency()tocmake_modules/IcebergThirdpartyToolchain.cmake, next to the existingresolve_*functions.ICEBERG_BUILD_TESTSandICEBERG_BUILD_BENCHMARKS, the same conditions that already guard the test and benchmark subdirectories.prepare_fetchcontent()like the other resolvers, so a command-line-DCMAKE_COMPILE_WARNING_AS_ERROR=ONdoes not build the vendored GTest/Benchmark sources with-Werror.subprojects/*.wrap, so it needs no change.Verified
-DICEBERG_BUILD_BENCHMARKS=ON: both dependencies fetch;benchmark_smokeandschema_testbuild;ctest -R schema_testpasses.-DCMAKE_COMPILE_WARNING_AS_ERROR=ONwith benchmarks on: configure and build succeed.pre-commit run -aclean.This contribution was authored with assistance from Claude Opus 4.8, in line with the Iceberg guidelines for AI-assisted contributions (https://iceberg.apache.org/contribute/#guidelines-for-ai-assisted-contributions). All changes were reviewed and tested by the author.