Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions .evergreen/linker_tests_deps/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.15...4.0)
project (app C)
add_executable (app app.c)
find_package (bson-1.0 1.11 REQUIRED)
message ("-- libbson found version \"${bson-1.0_VERSION}\"")
target_link_libraries (app PRIVATE mongo::bson_static)

find_package (mongocrypt REQUIRED)
target_link_libraries (app PRIVATE mongo::mongocrypt)
target_link_libraries (app PRIVATE mongo::mongocrypt)
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# ChangeLog

## 1.16.0 (Unreleased)

### Changed

- Set CMake minimum required version to `3.15...4.0` (with maximum policy version set to `4.0`).

## 1.15.0

### New features
Expand Down
28 changes: 2 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
cmake_minimum_required (VERSION 3.12)

# Preempt the MSVC_RUNTIME_LIBRARY properties
if (POLICY CMP0091)
cmake_policy (SET CMP0091 NEW)
elseif (DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
message (WARNING "The CMAKE_MSVC_RUNTIME_LIBRARY variable is set, but CMake is too old to understand it")
endif ()

if (POLICY CMP0135)
cmake_policy (SET CMP0135 NEW)
endif ()
cmake_minimum_required (VERSION 3.15...4.0)

project (mongocrypt C)

Expand All @@ -27,20 +16,7 @@ option (ENABLE_BUILD_FOR_PPA "Maintainer-only option for preparing PPA build" OF
option (ENABLE_ONLINE_TESTS "Enable online tests and the csfle utility. Requires libmongoc." ON)

if (ENABLE_WINDOWS_STATIC_RUNTIME)
if (POLICY CMP0091)
# CMake 3.15 makes this trivial:
set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
else ()
# Fix it up the old-fashioned way
string (REPLACE "/MDd" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string (REPLACE "/MD" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
string (REPLACE "/MDd" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string (REPLACE "/MD" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string (APPEND CMAKE_C_FLAGS_DEBUG " /MTd")
string (APPEND CMAKE_CXX_FLAGS_DEBUG " /MTd")
string (APPEND CMAKE_C_FLAGS_RELEASE " /MT")
string (APPEND CMAKE_CXX_FLAGS_RELEASE " /MT")
endif ()
set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif ()

list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
Expand Down
9 changes: 1 addition & 8 deletions cmake/MongoC-Warnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,7 @@ function (mongoc_add_platform_compile_options)
endforeach ()
endfunction ()

if (CMAKE_VERSION VERSION_LESS 3.3)
# On older CMake versions, we'll just always pass the warning options, even
# if the generate warnings for the C++ check file
set (is_c_lang "1")
else ()
# $<COMPILE_LANGUAGE> is only valid in CMake 3.3+
set (is_c_lang "$<COMPILE_LANGUAGE:C>")
endif ()
set (is_c_lang "$<COMPILE_LANGUAGE:C>")

# These below warnings should always be unconditional hard errors, as the code is
# almost definitely broken
Expand Down
5 changes: 2 additions & 3 deletions kms-message/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.15...4.0)
project (kms_message
VERSION 0.0.1
LANGUAGES C
Expand All @@ -7,8 +7,7 @@ project (kms_message
set (CMAKE_C_STANDARD 99)

include (CheckCCompilerFlag)
# All targets obey visibility, not just library targets.
cmake_policy (SET CMP0063 NEW)

set (CMAKE_C_VISIBILITY_PRESET hidden)
set (KMS_MESSAGE_SOURCES
src/kms_b64.c
Expand Down