mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 12:29:08 +08:00
Merge pull request #2479 from ivysnow/mongoc
[libbson, mongo-c-driver] update to 1.9.0
This commit is contained in:
commit
ead35fd00a
@ -1,3 +1,3 @@
|
||||
Source: libbson
|
||||
Version: 1.6.2-2
|
||||
Version: 1.9.0
|
||||
Description: libbson is a library providing useful routines related to building, parsing, and iterating BSON documents.
|
||||
|
@ -2,27 +2,63 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 553f13b..03dc546 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -194,6 +194,8 @@ set (HEADERS
|
||||
@@ -230,6 +230,9 @@
|
||||
${SOURCE_DIR}/src/bson/bson-writer.h
|
||||
)
|
||||
|
||||
+add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
+
|
||||
+if (NOT BSON_ENABLE_STATIC)
|
||||
add_library(bson_shared SHARED ${SOURCES} ${HEADERS})
|
||||
add_library(bson_static STATIC ${SOURCES} ${HEADERS})
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set_target_properties(bson_shared PROPERTIES COMPILE_DEFINITIONS "BSON_COMPILATION;JSONSL_PARSE_NAN")
|
||||
@@ -263,16 +266,21 @@
|
||||
# must be handled specially since we can't resolve them
|
||||
set(BSON_SYSTEM_LIBS ${BSON_SYSTEM_LIBS} ws2_32)
|
||||
endif()
|
||||
+endif()
|
||||
|
||||
@@ -272,8 +274,10 @@ if (ENABLE_TESTS)
|
||||
DESTINATION ${PROJECT_BINARY_DIR}/tests)
|
||||
endif () # ENABLE_TESTS
|
||||
if (BSON_ENABLE_STATIC)
|
||||
add_library(bson_static STATIC ${SOURCES} ${HEADERS})
|
||||
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set_target_properties(bson_static PROPERTIES COMPILE_DEFINITIONS "BSON_COMPILATION;BSON_STATIC;JSONSL_PARSE_NAN")
|
||||
set_target_properties(bson_static PROPERTIES VERSION ${BSON_VERSION})
|
||||
set_target_properties(bson_static PROPERTIES OUTPUT_NAME "bson-static-${BSON_API_VERSION}")
|
||||
+ set(THREADS_PREFER_PTHREAD_FLAG 1)
|
||||
+ find_package (Threads REQUIRED)
|
||||
target_link_libraries(bson_static Threads::Threads)
|
||||
if (RT_LIBRARY)
|
||||
target_link_libraries (bson_static ${RT_LIBRARY})
|
||||
endif()
|
||||
+ find_library(M_LIBRARY m)
|
||||
if (M_LIBRARY)
|
||||
target_link_libraries (bson_static ${M_LIBRARY})
|
||||
endif()
|
||||
@@ -332,7 +340,7 @@
|
||||
add_executable (${bin} ${BSON_EXAMPLE_SOURCES})
|
||||
|
||||
+set(INSTALL_TARGETS bson_shared bson_static CACHE INTERNAL "List of library targets to install")
|
||||
+
|
||||
# Link against the shared lib like normal apps
|
||||
- target_link_libraries(${bin} bson_shared)
|
||||
+ target_link_libraries(${bin} bson_shared bson_static)
|
||||
|
||||
set (EXAMPLES ${EXAMPLES} ${bin})
|
||||
endfunction ()
|
||||
@@ -349,6 +357,7 @@
|
||||
endif () # ENABLE_EXAMPLES
|
||||
|
||||
set (BSON_HEADER_INSTALL_DIR "include/libbson-${BSON_API_VERSION}")
|
||||
+if (NOT BSON_ENABLE_STATIC)
|
||||
install(
|
||||
- TARGETS bson_shared bson_static
|
||||
+ TARGETS ${INSTALL_TARGETS}
|
||||
TARGETS bson_shared ${EXAMPLES}
|
||||
LIBRARY DESTINATION lib
|
||||
@@ -355,6 +364,7 @@
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
+endif ()
|
||||
if (BSON_ENABLE_STATIC)
|
||||
install(
|
||||
TARGETS bson_static ${EXAMPLES}
|
||||
diff --git a/src/bson/bson-compat.h b/src/bson/bson-compat.h
|
||||
index 05fc614..e8e2214 100644
|
||||
--- a/src/bson/bson-compat.h
|
||||
@ -31,21 +67,21 @@ index 05fc614..e8e2214 100644
|
||||
|
||||
|
||||
#ifdef BSON_OS_WIN32
|
||||
-# if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0600)
|
||||
+# if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0602)
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# ifndef _WIN32_WINNT
|
||||
-# define _WIN32_WINNT 0x0600
|
||||
+# define _WIN32_WINNT 0x0602
|
||||
# endif
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
-#if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0600)
|
||||
+#if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0602)
|
||||
#undef _WIN32_WINNT
|
||||
#endif
|
||||
#ifndef _WIN32_WINNT
|
||||
-#define _WIN32_WINNT 0x0600
|
||||
+#define _WIN32_WINNT 0x0602
|
||||
#endif
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
diff --git a/src/bson/bson-iso8601.c b/src/bson/bson-iso8601.c
|
||||
index 8beea90..cb4b531 100644
|
||||
--- a/src/bson/bson-iso8601.c
|
||||
+++ b/src/bson/bson-iso8601.c
|
||||
@@ -117,8 +117,8 @@ _bson_iso8601_date_parse (const char *str,
|
||||
@@ -115,8 +115,8 @@ _bson_iso8601_date_parse (const char *str,
|
||||
const char *day_ptr;
|
||||
const char *hour_ptr;
|
||||
const char *min_ptr;
|
||||
|
@ -1,10 +1,10 @@
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.6.2)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.9.0)
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://github.com/mongodb/libbson/archive/1.6.2.tar.gz"
|
||||
FILENAME "libbson-1.6.2.tar.gz"
|
||||
SHA512 c5848984d5db5ab62e698a0185139b20834d83fd7befef72336997097f639ef13e81053531385e96c7ba1fe3f3fe4ded517f5b8ee58f0914c5c807a9cb43766d
|
||||
URLS "https://github.com/mongodb/libbson/archive/1.9.0.tar.gz"
|
||||
FILENAME "libbson-1.9.0.tar.gz"
|
||||
SHA512 ced5e20a043096bbb2bd97f179c50fa105498fd089a54fcf7c0e3edda52030e7a6363ff1ab75c885649590a7d8846fa8adf880026cc059772cdfd87da23a244d
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
@ -14,9 +14,9 @@ vcpkg_apply_patches(
|
||||
)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(TARGET_TO_INSTALL bson_static)
|
||||
set(ENABLE_STATIC ON)
|
||||
else()
|
||||
set(TARGET_TO_INSTALL bson_shared)
|
||||
set(ENABLE_STATIC OFF)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
@ -24,7 +24,7 @@ vcpkg_configure_cmake(
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DENABLE_TESTS=OFF
|
||||
-DINSTALL_TARGETS=${TARGET_TO_INSTALL}
|
||||
-DENABLE_STATIC=${ENABLE_STATIC}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
@ -60,4 +60,27 @@ endif()
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson RENAME copyright)
|
||||
file(COPY ${SOURCE_PATH}/THIRD_PARTY_NOTICES DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson)
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/lib/cmake/libbson-static-1.0/libbson-static-1.0-config.cmake LIBBSON_CONFIG_CMAKE)
|
||||
string(REPLACE "/../../../" "/../../" LIBBSON_CONFIG_CMAKE "${LIBBSON_CONFIG_CMAKE}")
|
||||
string(REPLACE "/include/libbson-1.0" "/include" LIBBSON_CONFIG_CMAKE "${LIBBSON_CONFIG_CMAKE}")
|
||||
string(REPLACE "bson-static-1.0" "bson-1.0" LIBBSON_CONFIG_CMAKE "${LIBBSON_CONFIG_CMAKE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-config.cmake "${LIBBSON_CONFIG_CMAKE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/libbson-static-1.0/libbson-static-1.0-config.cmake "${LIBBSON_CONFIG_CMAKE}")
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/lib/cmake/libbson-static-1.0/libbson-static-1.0-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-static-1.0-config-version.cmake ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-config-version.cmake)
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/lib/cmake/libbson-static-1.0/libbson-static-1.0-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson-static-1.0)
|
||||
else()
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/lib/cmake/libbson-1.0/libbson-1.0-config.cmake LIBBSON_CONFIG_CMAKE)
|
||||
string(REPLACE "/../../../" "/../../" LIBBSON_CONFIG_CMAKE "${LIBBSON_CONFIG_CMAKE}")
|
||||
string(REPLACE "/include/libbson-1.0" "/include" LIBBSON_CONFIG_CMAKE "${LIBBSON_CONFIG_CMAKE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-config.cmake "${LIBBSON_CONFIG_CMAKE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/libbson-1.0/libbson-1.0-config.cmake "${LIBBSON_CONFIG_CMAKE}")
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/lib/cmake/libbson-1.0/libbson-1.0-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-1.0-config-version.cmake ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-config-version.cmake)
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/lib/cmake/libbson-1.0/libbson-1.0-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson-1.0)
|
||||
endif()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake ${CURRENT_PACKAGES_DIR}/lib/cmake)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
|
||||
|
||||
vcpkg_copy_pdbs()
|
@ -2,12 +2,12 @@ diff --git a/bson-macros.h b/bson-macros.h
|
||||
index 909bf6c..0a1f612 100644
|
||||
--- a/bson-macros.h
|
||||
+++ b/bson-macros.h
|
||||
@@ -69,7 +69,7 @@
|
||||
# ifdef BSON_COMPILATION
|
||||
# define BSON_API __declspec(dllexport)
|
||||
# else
|
||||
-# define BSON_API __declspec(dllimport)
|
||||
+# define BSON_API
|
||||
# endif
|
||||
#elif defined(__GNUC__)
|
||||
# define BSON_API __attribute__ ((visibility ("default")))
|
||||
@@ -87,7 +87,7 @@
|
||||
#elif defined(BSON_COMPILATION)
|
||||
#define BSON_API __declspec(dllexport)
|
||||
#else
|
||||
-#define BSON_API __declspec(dllimport)
|
||||
+#define BSON_API
|
||||
#endif
|
||||
#define BSON_CALL __cdecl
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: mongo-c-driver
|
||||
Version: 1.6.2-1
|
||||
Version: 1.9.0
|
||||
Build-Depends: libbson, openssl (uwp)
|
||||
Description: Client library written in C for MongoDB.
|
||||
|
@ -1,23 +0,0 @@
|
||||
diff --git a/build/cmake/FindBSON.cmake b/build/cmake/FindBSON.cmake
|
||||
index 06fd82e..3ac549d 100644
|
||||
--- a/build/cmake/FindBSON.cmake
|
||||
+++ b/build/cmake/FindBSON.cmake
|
||||
@@ -11,15 +11,15 @@ endif ()
|
||||
|
||||
find_path(BSON_INCLUDE_DIR
|
||||
NAMES
|
||||
- libbson-1.0/bson.h
|
||||
+ bson.h
|
||||
HINTS
|
||||
${BSON_ROOT_DIR}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
+ libbson-1.0
|
||||
+ include/libbson-1.0
|
||||
)
|
||||
|
||||
-set(BSON_INCLUDE_DIR "${BSON_INCLUDE_DIR}/libbson-1.0")
|
||||
-
|
||||
find_library(BSON
|
||||
NAMES
|
||||
"bson-1.0"
|
@ -1,8 +1,72 @@
|
||||
diff --git a/src/mongoc/mongoc-gridfs-file.c b/src/mongoc/mongoc-gridfs-file.c
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 5beb610..7e74ff7 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -55,6 +55,7 @@
|
||||
|
||||
include(MaintainerFlags)
|
||||
|
||||
+if ((NOT ENABLE_STATIC STREQUAL ON) AND (NOT ENABLE_STATIC STREQUAL AUTO))
|
||||
# The input variable BSON_ROOT_DIR is respected for backwards compatibility,
|
||||
# but you should use the standard CMAKE_PREFIX_PATH instead.
|
||||
message (STATUS "Searching for libbson CMake packages")
|
||||
@@ -67,12 +68,14 @@
|
||||
message ("-- libbson found version \"${BSON_VERSION}\"")
|
||||
message ("-- libbson include path \"${BSON_INCLUDE_DIRS}\"")
|
||||
message ("-- libbson libraries \"${BSON_LIBRARIES}\"")
|
||||
+endif ()
|
||||
|
||||
if (ENABLE_STATIC STREQUAL ON OR ENABLE_STATIC STREQUAL AUTO)
|
||||
find_package (libbson-static-1.0
|
||||
"${MONGOC_MAJOR_VERSION}.${MONGOC_MINOR_VERSION}.${MONGOC_MICRO_VERSION}"
|
||||
HINTS
|
||||
- ${BSON_ROOT_DIR})
|
||||
+ ${BSON_ROOT_DIR}
|
||||
+ REQUIRED)
|
||||
|
||||
if (ENABLE_STATIC STREQUAL ON AND NOT BSON_STATIC_LIBRARY)
|
||||
message (FATAL_ERROR "Static libbson not found. Pass -DENABLE_STATIC=OFF")
|
||||
@@ -627,6 +630,7 @@
|
||||
set (LIBS ${LIBS} ws2_32)
|
||||
endif()
|
||||
|
||||
+if (NOT MONGOC_ENABLE_STATIC)
|
||||
add_library(mongoc_shared SHARED ${SOURCES} ${HEADERS})
|
||||
set_target_properties(mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
target_link_libraries (mongoc_shared ${LIBS} ${BSON_LIBRARIES})
|
||||
@@ -638,6 +642,7 @@
|
||||
# This hack sets up standard symlink, libmongoc-1.0.so -> libmongoc-1.0.0.so
|
||||
set_target_properties(mongoc_shared PROPERTIES VERSION 0 SOVERSION ${MONGOC_MAJOR_VERSION})
|
||||
set_target_properties(mongoc_shared PROPERTIES OUTPUT_NAME "mongoc-${MONGOC_API_VERSION}" PREFIX "lib")
|
||||
+endif ()
|
||||
|
||||
if (MONGOC_ENABLE_STATIC)
|
||||
add_library(mongoc_static STATIC ${SOURCES} ${HEADERS})
|
||||
@@ -804,6 +809,7 @@
|
||||
file(COPY ${SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR}/tests)
|
||||
file(COPY ${SOURCE_DIR}/tests/release_files DESTINATION ${PROJECT_BINARY_DIR}/tests)
|
||||
|
||||
+if (NOT MONGOC_ENABLE_STATIC)
|
||||
install(
|
||||
TARGETS mongoc_shared ${EXAMPLES}
|
||||
LIBRARY DESTINATION lib
|
||||
@@ -810,10 +816,11 @@
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
+endif ()
|
||||
|
||||
if (MONGOC_ENABLE_STATIC)
|
||||
install(
|
||||
- TARGETS mongoc_shared mongoc_static ${EXAMPLES}
|
||||
+ TARGETS mongoc_static ${EXAMPLES}
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
index 5beb610..7e74ff7 100644
|
||||
--- a/src/mongoc/mongoc-gridfs-file.c
|
||||
+++ b/src/mongoc/mongoc-gridfs-file.c
|
||||
@@ -734,7 +734,7 @@ _mongoc_gridfs_file_refresh_page (mongoc_gridfs_file_t *file)
|
||||
@@ -753,7 +753,7 @@ _mongoc_gridfs_file_refresh_page (mongoc_gridfs_file_t *file)
|
||||
bson_t query;
|
||||
bson_t child;
|
||||
bson_t opts;
|
||||
@ -15,7 +79,7 @@ diff --git a/src/mongoc/mongoc-handshake.c b/src/mongoc/mongoc-handshake.c
|
||||
index 4e181bd..b274fc1 100644
|
||||
--- a/src/mongoc/mongoc-handshake.c
|
||||
+++ b/src/mongoc/mongoc-handshake.c
|
||||
@@ -195,7 +195,8 @@ _get_os_version (void)
|
||||
@@ -243,7 +243,8 @@ _get_os_version (void)
|
||||
char *ret = bson_malloc (HANDSHAKE_OS_VERSION_MAX);
|
||||
bool found = false;
|
||||
|
||||
@ -29,7 +93,7 @@ diff --git a/src/mongoc/mongoc-util.c b/src/mongoc/mongoc-util.c
|
||||
index 6dbb26d..7f33780 100644
|
||||
--- a/src/mongoc/mongoc-util.c
|
||||
+++ b/src/mongoc/mongoc-util.c
|
||||
@@ -46,7 +46,11 @@ _mongoc_hex_md5 (const char *input)
|
||||
@@ -69,7 +69,11 @@ _mongoc_hex_md5 (const char *input)
|
||||
void
|
||||
_mongoc_usleep (int64_t usec)
|
||||
{
|
||||
|
@ -1,21 +1,24 @@
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.6.2)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.9.0)
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://github.com/mongodb/mongo-c-driver/archive/1.6.2.tar.gz"
|
||||
FILENAME "mongo-c-driver-1.6.2.tar.gz"
|
||||
SHA512 3533fed665c70b71f0e9473156bab1575f60b0b3db412f19c0a625e1e35683a3077f96b8a0ba337fd755675029f47b68dc3a5fc8f39254bb0be589da57cffad3
|
||||
URLS "https://github.com/mongodb/mongo-c-driver/archive/1.9.0.tar.gz"
|
||||
FILENAME "mongo-c-driver-1.9.0.tar.gz"
|
||||
SHA512 e7785f336c38bbf7dd519351bba2facab025b4d2bcd1eef82e98606a21510af7f799edaf4b4f074bd4c5a17ad63176c276f8c57e499b8d9afd098bce274da4ae
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
PATCHES
|
||||
${CMAKE_CURRENT_LIST_DIR}/bson.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/fix-uwp.patch
|
||||
PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-uwp.patch
|
||||
)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(ENABLE_STATIC ON)
|
||||
else()
|
||||
set(ENABLE_STATIC OFF)
|
||||
endif()
|
||||
|
||||
set(ENABLE_SSL "WINDOWS")
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(ENABLE_SSL "OPENSSL")
|
||||
@ -23,11 +26,13 @@ endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR}
|
||||
-DENABLE_TESTS=OFF
|
||||
-DENABLE_EXAMPLES=OFF
|
||||
-DENABLE_SSL=${ENABLE_SSL}
|
||||
-DENABLE_STATIC=${ENABLE_STATIC}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
@ -43,23 +48,47 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib)
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib)
|
||||
|
||||
file(RENAME
|
||||
${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib
|
||||
${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib)
|
||||
file(RENAME
|
||||
${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib
|
||||
${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib)
|
||||
else()
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib)
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib)
|
||||
|
||||
# drop the __declspec(dllimport) when building static
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include
|
||||
PATCHES
|
||||
${CMAKE_CURRENT_LIST_DIR}/static.patch
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin)
|
||||
endif()
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver RENAME copyright)
|
||||
file(COPY ${SOURCE_PATH}/THIRD_PARTY_NOTICES DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver)
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/lib/cmake/libmongoc-static-1.0/libmongoc-static-1.0-config.cmake LIBMONGOC_CONFIG_CMAKE)
|
||||
string(REPLACE "/../../../" "/../../" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}")
|
||||
string(REPLACE "/include/libmongoc-1.0" "/include" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}")
|
||||
string(REPLACE "mongoc-static-1.0" "mongoc-1.0" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/mongo-c-driver-config.cmake "${LIBMONGOC_CONFIG_CMAKE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/libmongoc-static-1.0/libmongoc-static-1.0-config.cmake "${LIBMONGOC_CONFIG_CMAKE}")
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/lib/cmake/libmongoc-static-1.0/libmongoc-static-1.0-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/libmongoc-static-1.0-config-version.cmake ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/mongo-c-driver-config-version.cmake)
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/lib/cmake/libmongoc-static-1.0/libmongoc-static-1.0-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmongoc-static-1.0)
|
||||
else()
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/lib/cmake/libmongoc-1.0/libmongoc-1.0-config.cmake LIBMONGOC_CONFIG_CMAKE)
|
||||
string(REPLACE "/../../../" "/../../" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}")
|
||||
string(REPLACE "/include/libmongoc-1.0" "/include" LIBMONGOC_CONFIG_CMAKE "${LIBMONGOC_CONFIG_CMAKE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/mongo-c-driver-config.cmake "${LIBMONGOC_CONFIG_CMAKE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/libmongoc-1.0/libmongoc-1.0-config.cmake "${LIBMONGOC_CONFIG_CMAKE}")
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/lib/cmake/libmongoc-1.0/libmongoc-1.0-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/libmongoc-1.0-config-version.cmake ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/mongo-c-driver-config-version.cmake)
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/lib/cmake/libmongoc-1.0/libmongoc-1.0-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmongoc-1.0)
|
||||
endif()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake ${CURRENT_PACKAGES_DIR}/lib/cmake)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
13
ports/mongo-c-driver/static.patch
Normal file
13
ports/mongo-c-driver/static.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/mongoc-macros.h b/mongoc-macros.h
|
||||
index 909bf6c..0a1f612 100644
|
||||
--- a/mongoc-macros.h
|
||||
+++ b/mongoc-macros.h
|
||||
@@ -40,7 +40,7 @@
|
||||
#elif defined(MONGOC_COMPILATION)
|
||||
#define MONGOC_API __declspec(dllexport)
|
||||
#else
|
||||
-#define MONGOC_API __declspec(dllimport)
|
||||
+#define MONGOC_API
|
||||
#endif
|
||||
#define MONGOC_CALL __cdecl
|
||||
|
Loading…
Reference in New Issue
Block a user