We've decided to have a consistent approach to static library naming and provision of .cmake and .pc files across both the C Driver and mongocxx.
A summary of the approach is here:
- Naming convention: For library 'foo', static libraries will be always named 'foo-static' (or that such a name will exist as symlink) on all operating systems with an OS-specific suffix (e.g. ".a" or ".lib")
- Install both 'libfoo' and 'libfoo-static' pkg-config '.pc' files on all operating systems
- Install both 'libfoo-config' and 'libfoo-static-config' CMake '.cmake' files on all operating systems
- Static '.pc' and '.cmake' will not be installed if the static library is not built
- 'libfoo.pc' (dynamic) config files will list in 'Requires' only those dynamic dependencies that must have cflags and libraries expanded for applications to compile/link successfully (i.e. to find all headers and avoid unresolved reference errors). It will not list deep dependencies in 'Requires'. It will not have 'Requires.private'. It will not add any appropriate "FOO_STATIC" defines to cflags.
- 'libfoo-static.pc' config files will list all deep dependencies (whether dynamic or static) in 'Requires'. It will not have 'Requires.private'. It will add any appropriate "FOO_STATIC" defines to cflags.
- Cmake '.cmake' files will follow similar conventions as the '.pc' files.
- depends on
-
CDRIVER-2074 Convenient usage as a static library
- Development Complete
-
CDRIVER-2083 Distribute CMake config packages for statically linking to libbson and libmongoc
- Closed
-
CDRIVER-2037 Distribute pkg-config files for dynamic and static linking
- Closed
- is depended on by
-
CXX-1160 Please add instructions to compile Mongo C++ driver as static library
- Closed
- is duplicated by
-
CXX-1346 PR: fixing more __imp_bson and __imp_mongoc linker errors
- Closed