Commit 9221381
authored
build: move GTest and Google Benchmark setup into IcebergThirdpartyToolchain (#836)
## What
Fixes #829. The GoogleTest and Google Benchmark FetchContent setup lived
in `src/iceberg/test/CMakeLists.txt` and
`src/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
- Add `resolve_gtest_dependency()` and `resolve_benchmark_dependency()`
to `cmake_modules/IcebergThirdpartyToolchain.cmake`, next to the
existing `resolve_*` functions.
- Gate them on `ICEBERG_BUILD_TESTS` and `ICEBERG_BUILD_BENCHMARKS`, the
same conditions that already guard the test and benchmark
subdirectories.
- Both functions call `prepare_fetchcontent()` like the other resolvers,
so a command-line `-DCMAKE_COMPILE_WARNING_AS_ERROR=ON` does not build
the vendored GTest/Benchmark sources with `-Werror`.
- Version pins are unchanged. Only CMake is affected; Meson resolves
these through `subprojects/*.wrap`, so it needs no change.
## Verified
- `-DICEBERG_BUILD_BENCHMARKS=ON`: both dependencies fetch;
`benchmark_smoke` and `schema_test` build; `ctest -R schema_test`
passes.
- Tests and benchmarks both off: neither dependency is fetched.
- `-DCMAKE_COMPILE_WARNING_AS_ERROR=ON` with benchmarks on: configure
and build succeed.
- `pre-commit run -a` clean.
---
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.1 parent bfc0040 commit 9221381
3 files changed
Lines changed: 67 additions & 30 deletions
File tree
- cmake_modules
- src/iceberg
- benchmark
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
804 | 855 | | |
805 | 856 | | |
806 | 857 | | |
| |||
864 | 915 | | |
865 | 916 | | |
866 | 917 | | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 18 | + | |
36 | 19 | | |
37 | 20 | | |
38 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 18 | + | |
30 | 19 | | |
31 | 20 | | |
32 | 21 | | |
| |||
0 commit comments