Do not initialize ENABLE_TESTS with the auto-downloaded C Driver

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 4.2.0, 4.1.1
    • Affects Version/s: 4.0.0, 4.1.0
    • Component/s: None
    • None
    • None
    • C Drivers
    • Needed
    • Hide

      Although the C++ Driver intends to set ENABLE_TESTS=OFF by default since 4.0, when the C Driver is auto-downloaded, it sets ENABLE_TESTS=ON by default with a greater priority than the C++ Driver. CXX-3288 fixes this by ensuring the C++ Driver's CMake top-level cache variables are initialized before those in the auto-downloaded C Driver. Following CXX-3288, ENABLE_TESTS=OFF by default now behaves correctly even with the auto-downloaded C Driver.

      Show
      Although the C++ Driver intends to set ENABLE_TESTS=OFF by default since 4.0 , when the C Driver is auto-downloaded, it sets ENABLE_TESTS=ON by default with a greater priority than the C++ Driver. CXX-3288 fixes this by ensuring the C++ Driver's CMake top-level cache variables are initialized before those in the auto-downloaded C Driver. Following CXX-3288 , ENABLE_TESTS=OFF by default now behaves correctly even with the auto-downloaded C Driver.
    • None
    • None
    • None
    • None
    • None
    • None

      The call to include(FetchMongoC) which conditionally imports the auto-downloaded C Driver comes before top-level CMake cache variables such as ENABLE_TESTS are defined with option() or set(CACHE). This allows the imported C Driver to initialize the cache variable before the C++ Driver, which leads to the C++ Driver's default value being ignored due to the cache variable already being defined by the C Driver. This results in the ENABLE_TESTS=OFF default intended by CXX-3179 having lower priority than the C Driver's default of ENABLE_TESTS=ON.

            Assignee:
            Ezra Chung
            Reporter:
            Ezra Chung
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: