Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1348

Remove -Werror from CMAKE_CXX_FLAGS around calls to generate_export_header()

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.0-rc0
    • Affects Version/s: None
    • Component/s: Build
    • Labels:
      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.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: