Commit f4f6359
authored
build: scope warnings-as-error to project targets, not FetchContent subprojects (#819)
## What
Fixes #246. `-Werror` (via a global `CMAKE_COMPILE_WARNING_AS_ERROR`)
leaked into FetchContent-built dependencies, so a warning in a
third-party subproject (e.g. Arrow) could fail the whole build. As noted
on the issue, the global flag does not reliably isolate subprojects.
## How
- Removed the global `CMAKE_COMPILE_WARNING_AS_ERROR ON`.
- Set `COMPILE_WARNING_AS_ERROR ON` as a per-target property on
Iceberg's own shared/static libraries, so the project stays strict.
- Set `BUILD_WARNING_LEVEL PRODUCTION` for Arrow to suppress its
independent `-Werror` injection.
- Kept a defensive guard in `prepare_fetchcontent()` for the case where
`-DCMAKE_COMPILE_WARNING_AS_ERROR=ON` is passed on the command line.
## Verified
Iceberg targets still compile with `-Werror`; FetchContent subprojects
do not. Build + tests green (18/18).
---
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 5d31dee commit f4f6359
4 files changed
Lines changed: 6 additions & 4 deletions
File tree
- cmake_modules
- src/iceberg/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| 176 | + | |
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
| |||
0 commit comments