flatbuffers: Allow not setting -Werror conveniently
I am currently trying to compile Apache Arrow v0.14.1, which uses flatbuffers v0.10.0, using Clang 11. This is currently impossible since Clang 11 produces a warning, which becomes an error due to -Werror being set for flatbuffers. The problem is that Clang 11 has new warnings that didn’t exist when v0.10.0 came out.
While I understand that -Werror is a good idea to force fixing warnings as soon as they appear, I think there should be a way to deactivate that flag conveniently such that old versions continue to build with newer compilers. (Note that I say conveniently because generating a CMAKE_TOOLCHAIN_FILE could be a way to configure CMake with setting -Werror.) For example, some projects only set -Werror in Debug builds, but a new flag such as -DNO_WERROR would be fine, too.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (2 by maintainers)
Commits related to this issue
- [Build, cmake] Add -Werror override option This commit adds FLATBUFFERS_CXX_FLAGS cmake option. This option allows override the -Werror flag (or any other flags). Related issues: #6337, #5930 — committed to vglavnyy/flatbuffers by vglavnyy 3 years ago
- [Build, cmake] Add -Werror override option (#6429) * [Build, cmake] Add -Werror override option This commit adds FLATBUFFERS_CXX_FLAGS cmake option. This option allows override the -Werror flag (... — committed to google/flatbuffers by vglavnyy 3 years ago
Well, my current problem can’t be solved anyway… Even if you put a new flag in the next version of FlatBuffers, v0.10.0 will not be changed by that. I am arguing for a solution to avoid the problem in future versions.
But if we added a flag to omit
-Werror, wouldn’t that then not work for you either, since you use an old version? 😃