Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2211

cmake requires shared and static versions of libbson

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.7.0
    • Affects Version/s: 1.7.0
    • Component/s: None
    • Labels:
      None

      When compiling mongoc with cmake then both the normal shared library and the static cmake config is required to be available. This is despite the fact the static config is only installed when explicitly configured to do so.

      If libbson is built with CMake then it always builds and installs both static and shared libs. So I think this will be a problem only in the strange event that libbson is built with Autotools (which doesn't build and install the static libbson by default) and then libmongoc is built with CMake.

      Plan:

      • DONE Add ENABLE_STATIC option to libbson's CMakeLists.txt, default ON
      • Done Add ENABLE_STATIC=(ON|OFF|AUTO) option to libmongoc's CMakeLists.txt, default AUTO
      • Done If ENABLE_STATIC is ON, require static libbson, if AUTO and static libbson not found, set OFF, if OFF, don't search for static libbson
      • Done Update libmongoc's link-sample-program.sh test, to pass -DENABLE_STATIC=OFF when compiling libbson and libmongoc if the env var LINK_STATIC is not set

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: