Fixed port of mongo-c-driver/mongo-cxx-driver for android (#13850)

* Fixed port of mongo-c-driver/mongo-cxx-driver for android

* mongo-c-driver - Default value of ENABLE_SHM_COUNTERS is AUTO

* Use vcpkg provided variable VCPKG_TARGET_IS_ANDROID to detect android

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>

* Increased port-version of mongo-c-driver

* Increased port-version of mongo-cxx-driver

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
This commit is contained in:
Markus87 2020-10-14 00:50:53 +02:00 committed by GitHub
parent 26279b79d0
commit 98c5261b40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Source: mongo-c-driver
Version: 1.16.1-1
Port-Version: 1
Build-Depends: libbson, openssl (!windows), zlib
Description: Client library written in C for MongoDB.
Homepage: https://github.com/mongodb/mongo-c-driver

View File

@ -28,6 +28,14 @@ else()
set(ENABLE_SSL "OPENSSL")
endif()
if(VCPKG_TARGET_IS_ANDROID)
set(ENABLE_SRV OFF)
set(ENABLE_SHM_COUNTERS OFF)
else()
set(ENABLE_SRV AUTO)
set(ENABLE_SHM_COUNTERS AUTO)
endif()
file(READ ${CMAKE_CURRENT_LIST_DIR}/CONTROL _contents)
string(REGEX MATCH "\nVersion:[ ]*[^ \n]+" _contents "${_contents}")
string(REGEX REPLACE ".+Version:[ ]*([\\.0-9]+).*" "\\1" BUILD_VERSION "${_contents}")
@ -41,6 +49,8 @@ vcpkg_configure_cmake(
-DENABLE_BSON=SYSTEM
-DENABLE_TESTS=OFF
-DENABLE_EXAMPLES=OFF
-DENABLE_SRV=${ENABLE_SRV}
-DENABLE_SHM_COUNTERS=${ENABLE_SHM_COUNTERS}
-DENABLE_SSL=${ENABLE_SSL}
-DENABLE_ZLIB=SYSTEM
-DENABLE_STATIC=${ENABLE_STATIC}

View File

@ -1,5 +1,6 @@
Source: mongo-cxx-driver
Version: 3.4.0-5
Port-Version: 1
Build-Depends: libbson, mongo-c-driver, boost-smart-ptr, boost-optional, boost-utility
Homepage: https://github.com/mongodb/mongo-cxx-driver
Description: MongoDB C++ Driver.

View File

@ -0,0 +1,13 @@
diff --git "a/src/mongocxx/options/change_stream.cpp" "b/src/mongocxx/options/change_stream.cpp"
index 2c651a7e0..2e9c34eb6 100644
--- "a/src/mongocxx/options/change_stream.cpp"
+++ "b/src/mongocxx/options/change_stream.cpp"
@@ -108,7 +108,7 @@ bsoncxx::document::value change_stream::as_bson() const {
if ((count < 0) || (count >= std::numeric_limits<std::uint32_t>::max())) {
throw mongocxx::logic_error{mongocxx::error_code::k_invalid_parameter};
}
- out.append(bsoncxx::builder::basic::kvp("maxAwaitTimeMS", count));
+ out.append(bsoncxx::builder::basic::kvp("maxAwaitTimeMS", static_cast<int64_t>(count)));
}
return out.extract();

View File

@ -16,6 +16,7 @@ vcpkg_from_github(
fix-dependency-libbson.patch
fix-dependency-mongocdriver.patch
github-654.patch
fix-android.patch
)
if ("mnmlstc" IN_LIST FEATURES)