2022-11-03 05:39:31 +08:00
|
|
|
diff --git a/src/libbson/CMakeLists.txt b/src/libbson/CMakeLists.txt
|
2023-08-18 03:56:00 +08:00
|
|
|
index 61e926747..6b4c5a911 100644
|
2022-11-03 05:39:31 +08:00
|
|
|
--- a/src/libbson/CMakeLists.txt
|
|
|
|
+++ b/src/libbson/CMakeLists.txt
|
2023-08-18 03:56:00 +08:00
|
|
|
@@ -205,6 +205,7 @@ set (HEADERS_FORWARDING
|
2022-11-03 05:39:31 +08:00
|
|
|
${PROJECT_SOURCE_DIR}/src/bson/forwarding/bson.h
|
|
|
|
)
|
2023-08-18 03:56:00 +08:00
|
|
|
|
2022-11-03 05:39:31 +08:00
|
|
|
+if(NOT MONGOC_ENABLE_STATIC_BUILD)
|
|
|
|
add_library (bson_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
|
2023-08-18 03:56:00 +08:00
|
|
|
if (MSVC AND MSVC_VERSION VERSION_LESS 1900)
|
|
|
|
message (STATUS "Disabling warning C4756 for VS 2013 and older")
|
|
|
|
@@ -282,6 +283,7 @@ if (WIN32)
|
2022-11-03 05:39:31 +08:00
|
|
|
# must be handled specially since we can't resolve them
|
|
|
|
set (BSON_SYSTEM_LIBRARIES ${BSON_SYSTEM_LIBRARIES} ws2_32)
|
|
|
|
endif ()
|
|
|
|
+endif()
|
2023-08-18 03:56:00 +08:00
|
|
|
|
2022-11-03 05:39:31 +08:00
|
|
|
if (MONGOC_ENABLE_STATIC_BUILD)
|
|
|
|
add_library (bson_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
|
2023-08-18 03:56:00 +08:00
|
|
|
@@ -367,7 +369,7 @@ set (BSON_HEADER_INSTALL_DIR
|
2022-11-03 05:39:31 +08:00
|
|
|
)
|
2023-08-18 03:56:00 +08:00
|
|
|
|
2022-11-03 05:39:31 +08:00
|
|
|
if (MONGOC_ENABLE_STATIC_INSTALL)
|
|
|
|
- set (TARGETS_TO_INSTALL bson_shared bson_static)
|
|
|
|
+ set (TARGETS_TO_INSTALL bson_static)
|
|
|
|
else ()
|
|
|
|
set (TARGETS_TO_INSTALL bson_shared)
|
|
|
|
endif ()
|
2023-08-18 03:56:00 +08:00
|
|
|
@@ -418,12 +420,14 @@ configure_file (
|
2022-11-03 05:39:31 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src/libbson-1.0.pc
|
|
|
|
@ONLY)
|
2023-08-18 03:56:00 +08:00
|
|
|
|
2022-11-03 05:39:31 +08:00
|
|
|
+if(NOT MONGOC_ENABLE_STATIC_INSTALL)
|
|
|
|
install (
|
|
|
|
FILES
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src/libbson-1.0.pc
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
|
|
|
)
|
|
|
|
+endif()
|
2023-08-18 03:56:00 +08:00
|
|
|
|
2022-11-03 05:39:31 +08:00
|
|
|
if (MONGOC_ENABLE_STATIC_INSTALL)
|
|
|
|
configure_file (
|