2024-08-06 15:35:47 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2024-11-07 17:53:44 +08:00
|
|
|
index 3a40f52..d080479 100644
|
2024-08-06 15:35:47 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2024-11-07 17:53:44 +08:00
|
|
|
@@ -358,11 +358,11 @@ if (USE_SYSTEM_LIBBSON)
|
2024-08-06 15:35:47 +08:00
|
|
|
|
|
|
|
set (USING_SYSTEM_BSON TRUE)
|
|
|
|
if (NOT TARGET mongo::bson_shared)
|
|
|
|
- message (FATAL_ERROR "System libbson built without shared library target")
|
2024-11-07 17:53:44 +08:00
|
|
|
+
|
2024-08-06 15:35:47 +08:00
|
|
|
endif ()
|
|
|
|
set (BSON_LIBRARIES mongo::bson_shared)
|
|
|
|
if (NOT TARGET mongo::bson_static)
|
|
|
|
- message (FATAL_ERROR "System libbson built without static library target")
|
2024-11-07 17:53:44 +08:00
|
|
|
+
|
2024-08-06 15:35:47 +08:00
|
|
|
endif ()
|
|
|
|
set (BSON_STATIC_LIBRARIES mongo::bson_static)
|
|
|
|
endif ()
|
2020-05-02 03:43:06 +08:00
|
|
|
diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt
|
2024-11-07 17:53:44 +08:00
|
|
|
index fcab819..be0bfb2 100644
|
2020-05-02 03:43:06 +08:00
|
|
|
--- a/src/libmongoc/CMakeLists.txt
|
|
|
|
+++ b/src/libmongoc/CMakeLists.txt
|
2024-11-07 17:53:44 +08:00
|
|
|
@@ -889,7 +889,7 @@ set (
|
|
|
|
"${mongo-c-driver_SOURCE_DIR}/src/uthash"
|
2024-04-10 00:02:30 +08:00
|
|
|
)
|
2023-11-17 08:52:43 +08:00
|
|
|
|
2024-01-10 02:40:59 +08:00
|
|
|
-if (ENABLE_SHARED)
|
2021-10-27 13:31:19 +08:00
|
|
|
+if (NOT MONGOC_ENABLE_STATIC_BUILD)
|
2024-01-10 02:40:59 +08:00
|
|
|
add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
|
|
|
|
if(WIN32)
|
|
|
|
# Add resource-definition script for Windows shared library (.dll).
|
2024-11-07 17:53:44 +08:00
|
|
|
@@ -966,7 +966,7 @@ if (ENABLE_SHARED)
|
2024-05-08 05:39:12 +08:00
|
|
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
|
|
endif () # ENABLE_SHM_COUNTERS
|
|
|
|
|
|
|
|
-endif () # ENABLE_SHARED
|
|
|
|
+endif () # NOT MONGOC_ENABLE_STATIC_BUILD
|
|
|
|
|
|
|
|
if (MONGOC_ENABLE_STATIC_BUILD)
|
|
|
|
add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
|
2024-11-07 17:53:44 +08:00
|
|
|
@@ -1364,7 +1364,7 @@ if (MONGOC_ENABLE_STATIC_INSTALL)
|
2024-01-10 02:40:59 +08:00
|
|
|
list (APPEND TARGETS_TO_INSTALL mongoc_static)
|
2020-05-02 03:43:06 +08:00
|
|
|
endif ()
|
2023-11-17 08:52:43 +08:00
|
|
|
|
2024-01-10 02:40:59 +08:00
|
|
|
-if (ENABLE_SHARED)
|
2021-10-27 13:31:19 +08:00
|
|
|
+if (NOT MONGOC_ENABLE_STATIC_BUILD)
|
2024-01-10 02:40:59 +08:00
|
|
|
list (APPEND TARGETS_TO_INSTALL mongoc_shared)
|
2020-05-02 03:43:06 +08:00
|
|
|
endif ()
|
2024-01-10 02:40:59 +08:00
|
|
|
|
2024-11-07 17:53:44 +08:00
|
|
|
@@ -1419,6 +1419,7 @@ endif()
|
2023-11-17 08:52:43 +08:00
|
|
|
set_property(TARGET ${TARGETS_TO_INSTALL} APPEND PROPERTY pkg_config_INCLUDE_DIRECTORIES "${MONGOC_HEADER_INSTALL_DIR}")
|
|
|
|
|
2022-11-03 05:39:31 +08:00
|
|
|
# Deprecated alias for libmongoc-1.0.pc, see CDRIVER-2086.
|
2024-05-08 05:39:12 +08:00
|
|
|
+if (NOT MONGOC_ENABLE_STATIC_BUILD)
|
2022-11-03 05:39:31 +08:00
|
|
|
if (MONGOC_ENABLE_SSL)
|
|
|
|
configure_file (
|
2024-01-10 02:40:59 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/libmongoc-ssl-1.0.pc.in
|
2024-11-07 17:53:44 +08:00
|
|
|
@@ -1429,6 +1430,7 @@ if (MONGOC_ENABLE_SSL)
|
2022-11-03 05:39:31 +08:00
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
|
|
|
)
|
|
|
|
endif ()
|
2023-11-17 08:52:43 +08:00
|
|
|
+endif ()
|
2022-11-03 05:39:31 +08:00
|
|
|
|
|
|
|
include (CMakePackageConfigHelpers)
|
2023-11-17 08:52:43 +08:00
|
|
|
|