-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.7.0
-
Component/s: None
-
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