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

Allow a user to decide whether to build static or shared libraries

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.1.0
    • Affects Version/s: 3.0.1
    • Component/s: Build
    • None
    • Environment:
      Linux/Unix

      Currently, both the static and shared libraries are built when configuring and compiling with CMake. Usually, projects will allow you to specify whether you want to build the static or shared library, or both. For example, with autoconf, the configure script allows you to specify the flags --enable-static, --enable-shared, --disable-static, or --disable-shared. Similarly, CMake has a standard option, BUILD_SHARED_LIBS, which is usually specified during the configuration step, e.g. cmake -DBUILD_SHARED_LIBS=ON ...

      It would be useful the user could decide whether to build the C++ driver as a shared or static library. Sometimes it is useful to have only the static libraries installed. For example, when both the dynamic and static libraries are installed, a linker flag such as -lmongocxx will automatically choose the dynamic library. The only way to specify the static library in this case is to provide the full path to the static library instead of the flag with just the library name.

      This is not a major issue because the dynamic libraries can simply be removed after the installation step is complete. However, it would be nice if you could decide at configuration time which libraries (dynamic or static) you wanted to build so as to avoid unnecessary build steps.

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

              Created:
              Updated:
              Resolved: