Commit 5d05a2b
build: mark all protobuf headers as system headers (#132)
This PR makes sure that all protobuf headers, either from the library or
the generated ones, are marked as `SYSTEM` headers. This causes most
compilers to include them via `-isystem` instead of `-I`, which, in
turn, suppresses warnings from those headers and, thus, enables
compiling the main project with `-Werror`.
This is achieved with the combination of several changes:
* Several unnecessary `include_directories` statements have been
removed. These are unnecessary because we already depend on the
`protobuf::libprotobuf` target, which includes header dependencies.
* We don't unnecessarily set the `target_include_directories` for the
protobuf library headers for the same reason.
* We mark the Protobuf library downloaded by `FetchContent` as `SYSTEM`,
which marks all targets in that library as `SYSTEM`.
* We manually mark our `substrait::proto` target as `SYSTEM`.
I am not 100% sure if the first point doesn't break some legacy versions
of Protobuf. My best guess is that those would be so old that they do
not work anymore anyways. I am leaving this message in case somebody
runs into problems, though. In that case, the `include_directories`
commands should only be set for the legacy case.
Signed-off-by: Ingo Müller <ingomueller@google.com>
Co-authored-by: David Sisson <EpsilonPrime@users.noreply.github.com>1 parent 2f5524d commit 5d05a2b
2 files changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
94 | 92 | | |
95 | 93 | | |
96 | 94 | | |
97 | | - | |
| 95 | + | |
98 | 96 | | |
99 | | - | |
100 | | - | |
101 | 97 | | |
102 | 98 | | |
103 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
0 commit comments