Make it convenient and obvious how direct users of libbson and libmongoc should compile their code and link to libbson as a dynamic or standard library. This applies to Unix and Windows, and it applies to people using CMake, pkg-config, or manually specifying configuration flags.
Coordinate with immediate dependency libraries like the C++11 Driver so that its users, too, can conveniently compile and link in all these configurations.
Possible steps (my current understanding):
- Done Introduce preprocessor symbols BSON_STATIC and MONGOC_STATIC, by analogy with this code from the legacy C++ driver - this should resolve
CDRIVER-2054 - Done Update our .pc files so pkg-config --static defines the right options
- Done Update our CMake modules so the C++11 driver (and similar direct dependency libraries or applications that use CMake) can choose to link statically or dynamically
- Done I removed the CMake options BSON_ROOT_DIR and MONGOC_ROOT_DIR in
CDRIVER-1058, in favor of the standard CMAKE_PREFIX_PATH, should we reintroduce them? This is ok? - Done Update libbson and libmongoc docs to better explain how to use the libbson and libmongoc as static or shared libs
- Done Instructions for linking, statically or not, with libmongoc and libbson using Visual Studio GUI
- Add "#pragma lib" statements to bson.h and mongoc.h so Visual Studio users can have their linker options automatically configured
- is depended on by
-
CXX-1257 Revise static library naming and link configuration
- Development Complete
- is related to
-
CDRIVER-2157 Linking to libmongoc with MinGW-64 fails to find crypt32.lib
- Closed
- related to
-
CDRIVER-2171 make uninstall leaves cmake & static symlink files behind
- Closed