Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Co-authored-by: David Sisson <[email protected]>
- Loading branch information