-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Build
-
None
generate_export_header() (from the GenerateExportHeader CMake module) adds a configure test to see whether the compiler supports a "deprecated" attribute. Unfortunately, this configure test interacts poorly with the -Werror: if -Werror is contained in CMAKE_CXX_FLAGS, then this configure test always fails, because the deprecation warning generated by the configure program is always promoted to an error (and an error is supposed to indicate that the compiler lacks support for such an attribute).
As such, all of our CI builders which specify -Werror in CMAKE_CXX_FLAGS are declaring BSONCXX_DEPRECATED/MONGOCXX_DEPRECATED as empty macros.
As a temporary workaround, we could programmatically remove -Werror from CMAKE_CXX_FLAGS right before calling generate_export_header(), and add it back after the generate_export_header() call if the removal attempt was successful.