![]() ![]() The sample commands utilize cmake’s out-of-source build feature to keep build artifacts separate from source files. The following assumes you are compiling for 64-bit Windows using Visual Studio 2015 Express, which can be freely downloaded from Microsoft. Start by generating Visual Studio project files. Specifying the generator will ensure that the build configuration is known with certainty, rather than relying on the toolchain that CMake happens to find. This is especially important if multiple versions of Visual Studio are installed on the system or if alternate build tools (e.g., MinGW, MSYS2, Cygwin, etc.) are present on the system. On the Windows platform with Visual Studio, it may be necessary to specify the CMake generator to use. Preparing a build on Windows with Visual Studio ¶ The configuration will detect if libbson is not installed and use the bundled libbson.Īdditionally, it is possible to build only libbson by setting the -DENABLE_MONGOC=OFF option: Mongo-c-driver contains a copy of libbson, in case your system does not already have libbson installed. ![]() ![]() If cmake concludes with anything different, then it is likely an error occurred. The final line of output should look something like this: - Build files have been written to: /home/user/mongo-c-driver-1.17.5/cmake-build If cmake completed successfully, you will see a considerable amount of output describing your build configuration. For a list of all configure options, run cmake -L. Another useful cmake option is -DCMAKE_BUILD_TYPE=Release for a release optimized build and -DCMAKE_BUILD_TYPE=Debug for a debug build. The -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF option is recommended, see Initialization and cleanup. $ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF. The following snippet will download and extract the driver, and configure it: $ wget See the subsequent sections for additional platform-specific instructions. While the $ prompt is used throughout, the instructions below will work on Linux, macOS, and Windows (assuming that CMake is in the user’s shell path in all cases). The instructions in this document utilize cmake’s out-of-source build feature to keep build artifacts separate from source files. The most recent release of libmongoc and libbson, both of which are included in mongo-c-driver, can be downloaded here. Preparing a build from a release tarball ¶ ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |