[dev-libs/libmongocrypt] wire up tests and fix some cmake4isms

This commit is contained in:
2025-11-09 12:02:37 +01:00
parent e1d5dbf030
commit b841574c7b
3 changed files with 87 additions and 94 deletions

View File

@@ -1,8 +1,10 @@
.evergreen/linker_tests_deps/app/CMakeLists.txt | 4 +--
CMakeLists.txt | 34 ++++---------------------
cmake/FetchMongoC.cmake | 8 +++++-
cmake/IntelDFP.cmake | 8 +++++-
cmake/MongoC-Warnings.cmake | 9 +------
kms-message/CMakeLists.txt | 5 ++--
4 files changed, 10 insertions(+), 42 deletions(-)
6 files changed, 24 insertions(+), 44 deletions(-)
diff --git a/.evergreen/linker_tests_deps/app/CMakeLists.txt b/.evergreen/linker_tests_deps/app/CMakeLists.txt
index 1a5abb1d..9b9f907e 100644
@@ -78,6 +80,54 @@ index c768faca..69e99f9d 100644
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE CALC_RELEASE_VERSION
RESULT_VARIABLE CALC_RELEASE_VERSION_RESULT
diff --git a/cmake/FetchMongoC.cmake b/cmake/FetchMongoC.cmake
index f4c46985..be56b18c 100644
--- a/cmake/FetchMongoC.cmake
+++ b/cmake/FetchMongoC.cmake
@@ -27,12 +27,18 @@ FetchContent_Declare (
embedded_mcd
URL "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/${MONGOC_FETCH_TAG_FOR_LIBBSON}.tar.gz"
PATCH_COMMAND ${patch_command} --verbose
+ SOURCE_SUBDIR "NO_ADD_SUBDIRECTORY" # add_subdirectory() is handled by ImportBSON.cmake.
)
# Populate it:
FetchContent_GetProperties (embedded_mcd)
if (NOT embedded_mcd_POPULATED)
message (STATUS "Downloading mongo-c-driver ${MONGOC_FETCH_TAG_FOR_LIBBSON} for libbson")
- FetchContent_Populate (embedded_mcd)
+ if("${CMAKE_VERSION}" VERSION_LESS "3.18.0")
+ # SOURCE_SUBDIR is not yet supported.
+ FetchContent_Populate(embedded_mcd)
+ else()
+ FetchContent_MakeAvailable(embedded_mcd)
+ endif()
endif ()
# Store the directory path to the external mongoc project:
get_filename_component (MONGOCRYPT_MONGOC_DIR "${embedded_mcd_SOURCE_DIR}" ABSOLUTE)
diff --git a/cmake/IntelDFP.cmake b/cmake/IntelDFP.cmake
index 74d0eaa0..2f62938c 100644
--- a/cmake/IntelDFP.cmake
+++ b/cmake/IntelDFP.cmake
@@ -44,12 +44,18 @@ FetchContent_Declare (
URL "${_default_url}"
${_hash_arg}
PATCH_COMMAND ${patch_command} --verbose
+ SOURCE_SUBDIR "NO_ADD_SUBDIRECTORY" # Targets are manually defined below.
)
FetchContent_GetProperties (intel_dfp)
if (NOT intel_dfp_POPULATED)
message (STATUS "Obtaining Intel Decimal FP library: ${INTEL_DFP_LIBRARY_URL}")
- FetchContent_Populate (intel_dfp)
+ if("${CMAKE_VERSION}" VERSION_LESS "3.18.0")
+ # SOURCE_SUBDIR is not yet supported.
+ FetchContent_Populate(intel_dfp)
+ else()
+ FetchContent_MakeAvailable(intel_dfp)
+ endif()
endif ()
# This list of sources was generated by copying the MongoDB server and removing any unnecessary.
diff --git a/cmake/MongoC-Warnings.cmake b/cmake/MongoC-Warnings.cmake
index 4784c933..eb104f48 100644
--- a/cmake/MongoC-Warnings.cmake