Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongo-cxx-driver: add version 3.7.0, update boost #14924

Merged
merged 3 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 36 additions & 10 deletions recipes/mongo-cxx-driver/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,52 @@
sources:
"3.7.0":
url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.7.0/mongo-cxx-driver-r3.7.0.tar.gz"
sha256: "fb2da11178db728f63147fe4b0c7509eb49b1b02c5cb55f9bee5f927e451a0c7"
"3.6.7":
url: "https://github.com/mongodb/mongo-cxx-driver/archive/debian/3.6.7-1.tar.gz"
sha256: "62a0a16e4a35289e1692f60cf07a7f6957485446b7bc1d82306b731ad6763fb9"
"3.6.6":
url: "https://github.com/mongodb/mongo-cxx-driver/archive/r3.6.6.tar.gz"
sha256: "f989c371800458ae45ef69f6d9566e010f9420435a01bf5eb14db77fc024662e"
url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.6/mongo-cxx-driver-r3.6.6.tar.gz"
sha256: "d5906b9e308a8a353a2ef92b699c9b27ae28ec6b34fdda94e15d2981b27e64ca"
"3.6.2":
url: "https://github.com/mongodb/mongo-cxx-driver/archive/r3.6.2.tar.gz"
sha256: "f50a1acb98a473f0850e2766dc7e84c05415dc63b1a2f851b77b12629ac14d62"
url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.2/mongo-cxx-driver-r3.6.2.tar.gz"
sha256: "24325dce74723f7632da76d0eeb5f5020828498cc5bc1a624c6d7117efb2b7cf"
"3.6.1":
url: https://github.com/mongodb/mongo-cxx-driver/archive/r3.6.1.tar.gz
sha256: c6d1b307f7b074d178c4a815d8739195fb4d7870701064bdad6f1f2360ae0af9
url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.1/mongo-cxx-driver-r3.6.1.tar.gz"
sha256: "83523e897ef18f7ce05d85d1632dd4ba486c264a1b89c09020163ab29e11eab7"
patches:
"3.7.0":
- patch_file: "patches/3.7.0-dirs.patch"
patch_description: "disable documentation features, fix directories"
patch_type: "conan"
- patch_file: "patches/poly_use_std_define.patch"
patch_description: "use poly macro instead __cplusplus"
patch_type: "portability"
"3.6.7":
- patch_file: "patches/dirs_and_tests.patch"
- patch_file: "patches/3.6.x-dirs_and_tests.patch"
patch_description: "disable test and documentation features, fix directories"
patch_type: "conan"
- patch_file: "patches/poly_use_std_define.patch"
patch_description: "use poly macro instead __cplusplus"
patch_type: "portability"
"3.6.6":
- patch_file: "patches/dirs_and_tests.patch"
- patch_file: "patches/3.6.x-dirs_and_tests.patch"
patch_description: "disable test and documentation features, fix directories"
patch_type: "conan"
- patch_file: "patches/poly_use_std_define.patch"
patch_description: "use poly macro instead __cplusplus"
patch_type: "portability"
"3.6.2":
- patch_file: "patches/dirs_and_tests.patch"
- patch_file: "patches/3.6.x-dirs_and_tests.patch"
patch_description: "disable test and documentation features, fix directories"
patch_type: "conan"
- patch_file: "patches/poly_use_std_define.patch"
patch_description: "use poly macro instead __cplusplus"
patch_type: "portability"
"3.6.1":
- patch_file: "patches/dirs_and_tests.patch"
- patch_file: "patches/3.6.x-dirs_and_tests.patch"
patch_description: "disable test and documentation features, fix directories"
patch_type: "conan"
- patch_file: "patches/poly_use_std_define.patch"
patch_description: "use poly macro instead __cplusplus"
patch_type: "portability"
3 changes: 2 additions & 1 deletion recipes/mongo-cxx-driver/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def configure(self):
def requirements(self):
self.requires("mongo-c-driver/1.22.0")
if self.options.polyfill == "boost":
self.requires("boost/1.79.0")
self.requires("boost/1.80.0")
toge marked this conversation as resolved.
Show resolved Hide resolved

@property
def _minimal_std_version(self):
Expand Down Expand Up @@ -130,6 +130,7 @@ def generate(self):
tc.variables["MONGOCXX_ENABLE_SSL"] = self.options.with_ssl
if not valid_min_cppstd(self, self._minimal_std_version):
tc.variables["CMAKE_CXX_STANDARD"] = self._minimal_std_version
tc.variables["ENABLE_TESTS"] = False
# Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840)
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"
tc.generate()
Expand Down
80 changes: 80 additions & 0 deletions recipes/mongo-cxx-driver/all/patches/3.7.0-dirs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 20254fa..d7dc7c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -206,6 +206,7 @@ set (BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR})

include (MakeDistFiles)

+if(FALSE)
add_custom_target(hugo_dir
COMMAND ${CMAKE_COMMAND} -E make_directory hugo
)
@@ -261,6 +262,7 @@ add_custom_target(format-lint
add_custom_target(docs
DEPENDS hugo doxygen-current
)
+endif()

set(THIRD_PARTY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party)

@@ -270,6 +272,9 @@ if (ENABLE_TESTS)
enable_testing()
endif ()

+set(MONGO_CXX_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(MONGO_CXX_PROJECT_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
add_subdirectory(src)

add_subdirectory(examples EXCLUDE_FROM_ALL)
@@ -281,6 +286,7 @@ add_subdirectory(benchmark EXCLUDE_FROM_ALL)
# CMake does not implement anything like 'dist' from autotools.
# This implementation is based on the one in GnuCash.

+if(FALSE)
add_subdirectory (cmake)
add_subdirectory (data)
add_subdirectory (docs)
@@ -381,4 +387,4 @@ endif ()
if (CMAKE_GENERATOR_TOOLSET)
message (STATUS "\tinstance: ${CMAKE_GENERATOR_TOOLSET}")
endif ()
-
+endif()
diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt
index d87d588..1aefd91 100644
--- a/src/bsoncxx/CMakeLists.txt
+++ b/src/bsoncxx/CMakeLists.txt
@@ -71,7 +71,7 @@ set(BSONCXX_VERSION_NO_EXTRA ${BSONCXX_VERSION_MAJOR}.${BSONCXX_VERSION_MINOR}.$
set(BSONCXX_VERSION ${BSONCXX_VERSION_NO_EXTRA}${BSONCXX_VERSION_EXTRA})
message ("bsoncxx version: ${BSONCXX_VERSION}")
set(BSONCXX_INLINE_NAMESPACE "v${BSONCXX_ABI_VERSION}")
-set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/bsoncxx/${BSONCXX_INLINE_NAMESPACE}" CACHE INTERNAL "")
+set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE INTERNAL "")

set(LIBBSON_REQUIRED_VERSION 1.13.0)
set(LIBBSON_REQUIRED_ABI_VERSION 1.0)
@@ -94,7 +94,8 @@ if(TARGET bson_shared OR TARGET bson_static)
endif()
else()
# Attempt to find libbson by new package name (without lib).
- find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} ${LIBBSON_REQUIRED_VERSION} QUIET)
+ find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} REQUIRED)
+ set(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND TRUE)

if(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND)
message ("found libbson version ${bson-${LIBBSON_REQUIRED_ABI_VERSION}_VERSION}")
diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt
index 7106040..3be4b83 100644
--- a/src/mongocxx/CMakeLists.txt
+++ b/src/mongocxx/CMakeLists.txt
@@ -27,7 +27,7 @@ set(MONGOCXX_VERSION_NO_EXTRA ${MONGOCXX_VERSION_MAJOR}.${MONGOCXX_VERSION_MINOR
set(MONGOCXX_VERSION ${MONGOCXX_VERSION_NO_EXTRA}${MONGOCXX_VERSION_EXTRA})
message ("mongocxx version: ${MONGOCXX_VERSION}")
set(MONGOCXX_INLINE_NAMESPACE "v${MONGOCXX_ABI_VERSION}")
-set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/mongocxx/${MONGOCXX_INLINE_NAMESPACE}" CACHE INTERNAL "")
+set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/" CACHE INTERNAL "")

set(LIBMONGOC_REQUIRED_VERSION 1.19.0)
set(LIBMONGOC_REQUIRED_ABI_VERSION 1.0)
21 changes: 3 additions & 18 deletions recipes/mongo-cxx-driver/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
cmake_minimum_required(VERSION 3.8)
project(test_package LANGUAGES CXX)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(mongocxx REQUIRED CONFIG)

add_executable(${PROJECT_NAME} ../test_package/test_package.cpp)

if(${MONGO-CXX-DRIVER_POLYFILL} STREQUAL "std")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
elseif(${MONGO-CXX-DRIVER_POLYFILL} STREQUAL "experimental")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
else()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
endif()

if(TARGET mongo::mongocxx_shared)
target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongocxx_shared mongo::bsoncxx_shared)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongocxx_static mongo::bsoncxx_static)
endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/
${CMAKE_CURRENT_BINARY_DIR}/test_package/)
2 changes: 2 additions & 0 deletions recipes/mongo-cxx-driver/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.7.0":
folder: all
"3.6.7":
folder: all
"3.6.6":
Expand Down