121 lines
		
	
	
		
			4.7 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			121 lines
		
	
	
		
			4.7 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
 .evergreen/linker_tests_deps/app/CMakeLists.txt |  4 +--
 | 
						|
 CMakeLists.txt                                  | 34 ++++---------------------
 | 
						|
 cmake/MongoC-Warnings.cmake                     |  9 +------
 | 
						|
 kms-message/CMakeLists.txt                      |  5 ++--
 | 
						|
 4 files changed, 10 insertions(+), 42 deletions(-)
 | 
						|
 | 
						|
diff --git a/.evergreen/linker_tests_deps/app/CMakeLists.txt b/.evergreen/linker_tests_deps/app/CMakeLists.txt
 | 
						|
index 1a5abb1d..9b9f907e 100644
 | 
						|
--- a/.evergreen/linker_tests_deps/app/CMakeLists.txt
 | 
						|
+++ b/.evergreen/linker_tests_deps/app/CMakeLists.txt
 | 
						|
@@ -1,4 +1,4 @@
 | 
						|
-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)
 | 
						|
@@ -6,4 +6,4 @@ 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)
 | 
						|
\ No newline at end of file
 | 
						|
+target_link_libraries (app PRIVATE mongo::mongocrypt)
 | 
						|
diff --git a/CMakeLists.txt b/CMakeLists.txt
 | 
						|
index c768faca..69e99f9d 100644
 | 
						|
--- a/CMakeLists.txt
 | 
						|
+++ b/CMakeLists.txt
 | 
						|
@@ -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)
 | 
						|
 
 | 
						|
@@ -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)
 | 
						|
@@ -216,10 +192,10 @@ if (BUILD_VERSION STREQUAL "0.0.0")
 | 
						|
       file (STRINGS ${PROJECT_SOURCE_DIR}/VERSION_CURRENT BUILD_VERSION)
 | 
						|
       message (STATUS "File VERSION_CURRENT contained BUILD_VERSION ${BUILD_VERSION}")
 | 
						|
    else ()
 | 
						|
-      find_package (PythonInterp)
 | 
						|
-      if (PYTHONINTERP_FOUND)
 | 
						|
+      find_package (Python COMPONENTS Interpreter)
 | 
						|
+      if (TARGET Python::Interpreter)
 | 
						|
          execute_process (
 | 
						|
-            COMMAND ${PYTHON_EXECUTABLE} etc/calc_release_version.py
 | 
						|
+            COMMAND "${Python_EXECUTABLE}" etc/calc_release_version.py
 | 
						|
             WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
 | 
						|
             OUTPUT_VARIABLE CALC_RELEASE_VERSION
 | 
						|
             RESULT_VARIABLE CALC_RELEASE_VERSION_RESULT
 | 
						|
diff --git a/cmake/MongoC-Warnings.cmake b/cmake/MongoC-Warnings.cmake
 | 
						|
index 4784c933..eb104f48 100644
 | 
						|
--- a/cmake/MongoC-Warnings.cmake
 | 
						|
+++ b/cmake/MongoC-Warnings.cmake
 | 
						|
@@ -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
 | 
						|
diff --git a/kms-message/CMakeLists.txt b/kms-message/CMakeLists.txt
 | 
						|
index 6848e61f..ff210d4f 100644
 | 
						|
--- a/kms-message/CMakeLists.txt
 | 
						|
+++ b/kms-message/CMakeLists.txt
 | 
						|
@@ -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
 | 
						|
@@ -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
 |