2020-03-26 11:43:02 +08:00
|
|
|
diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt
|
2021-10-27 13:31:19 +08:00
|
|
|
index 5b7f448f2..8881f5194 100644
|
2020-03-26 11:43:02 +08:00
|
|
|
--- a/src/libmongoc/CMakeLists.txt
|
|
|
|
+++ b/src/libmongoc/CMakeLists.txt
|
2021-10-27 13:31:19 +08:00
|
|
|
@@ -729,6 +729,9 @@ if (NOT MONGOC_ENABLE_STATIC_BUILD)
|
2020-03-26 11:43:02 +08:00
|
|
|
add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
|
|
|
|
set_target_properties (mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden)
|
2021-10-27 13:31:19 +08:00
|
|
|
target_link_libraries (mongoc_shared PRIVATE ${LIBRARIES} PUBLIC mongo::bson_shared)
|
2020-03-26 11:43:02 +08:00
|
|
|
+if (WIN32)
|
2021-10-27 13:31:19 +08:00
|
|
|
+ target_link_libraries (mongoc_shared PRIVATE Advapi32)
|
2020-03-26 11:43:02 +08:00
|
|
|
+endif()
|
2020-05-02 03:43:06 +08:00
|
|
|
target_include_directories (mongoc_shared BEFORE PUBLIC ${MONGOC_INTERNAL_INCLUDE_DIRS})
|
2021-10-27 13:31:19 +08:00
|
|
|
target_include_directories (mongoc_shared PRIVATE ${ZLIB_INCLUDE_DIRS})
|
2020-05-02 03:43:06 +08:00
|
|
|
target_include_directories (mongoc_shared PRIVATE ${LIBMONGOCRYPT_INCLUDE_DIRECTORIES})
|
2021-10-27 13:31:19 +08:00
|
|
|
@@ -749,6 +752,9 @@ set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BAS
|
2020-05-02 03:43:06 +08:00
|
|
|
else ()
|
2020-03-26 11:43:02 +08:00
|
|
|
add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
|
2021-10-27 13:31:19 +08:00
|
|
|
target_link_libraries (mongoc_static ${STATIC_LIBRARIES} mongo::bson_static)
|
|
|
|
+ if (WIN32)
|
|
|
|
+ target_link_libraries (mongoc_static Advapi32)
|
|
|
|
+ endif()
|
|
|
|
if (NOT WIN32 AND ENABLE_PIC)
|
|
|
|
target_compile_options (mongoc_static PUBLIC -fPIC)
|
|
|
|
message ("Adding -fPIC to compilation of mongoc_static components")
|