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

Remove -Werror from CMAKE_CXX_FLAGS around calls to generate_export_header()

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0-rc0
    • Component/s: Build
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              acm Andrew Morrow
              Reporter:
              acm Andrew Morrow
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: