From a49d450a54c9116d107e921505f1d22efdaa6365 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Mon, 30 Sep 2024 10:52:26 -0700 Subject: [PATCH] [Build] Bumped the minimum version of cmake (#37702) Per https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md, the minimum version of cmake to support is 3.16 so let's change our cmake builds' requirements accordingly. Closes #37702 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37702 from veblush:cmake316 bb4ed1a1be5e9374980c922aac3dc1ccd27d1266 PiperOrigin-RevId: 680639191 --- CMakeLists.txt | 2 +- examples/android/helloworld/app/CMakeLists.txt | 2 +- examples/cpp/auth/CMakeLists.txt | 2 +- examples/cpp/cancellation/CMakeLists.txt | 2 +- examples/cpp/cmake/common.cmake | 2 +- examples/cpp/compression/CMakeLists.txt | 2 +- examples/cpp/deadline/CMakeLists.txt | 2 +- examples/cpp/error_details/CMakeLists.txt | 2 +- examples/cpp/error_handling/CMakeLists.txt | 2 +- examples/cpp/flow_control/CMakeLists.txt | 2 +- examples/cpp/generic_api/CMakeLists.txt | 2 +- examples/cpp/health/CMakeLists.txt | 2 +- examples/cpp/helloworld/CMakeLists.txt | 2 +- examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt | 2 +- examples/cpp/interceptors/CMakeLists.txt | 2 +- examples/cpp/keepalive/CMakeLists.txt | 2 +- examples/cpp/load_balancing/CMakeLists.txt | 2 +- examples/cpp/metadata/CMakeLists.txt | 2 +- examples/cpp/multiplex/CMakeLists.txt | 2 +- examples/cpp/otel/CMakeLists.txt | 2 +- examples/cpp/otel/codelab/CMakeLists.txt | 2 +- examples/cpp/otel/ostream/CMakeLists.txt | 2 +- examples/cpp/retry/CMakeLists.txt | 2 +- examples/cpp/route_guide/CMakeLists.txt | 2 +- examples/cpp/wait_for_ready/CMakeLists.txt | 2 +- src/android/test/interop/app/CMakeLists.txt | 2 +- src/cpp/README.md | 2 +- templates/CMakeLists.txt.template | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da1e9c4ae87..85b51d334d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.16) set(PACKAGE_NAME "grpc") set(PACKAGE_VERSION "1.68.0-dev") diff --git a/examples/android/helloworld/app/CMakeLists.txt b/examples/android/helloworld/app/CMakeLists.txt index 4524d3e0250..70c2d65668c 100644 --- a/examples/android/helloworld/app/CMakeLists.txt +++ b/examples/android/helloworld/app/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) set(helloworld_PROTOBUF_PROTOC_EXECUTABLE "/usr/local/bin/protoc" CACHE STRING "Protoc binary on host") set(helloworld_GRPC_CPP_PLUGIN_EXECUTABLE "/usr/local/bin/grpc_cpp_plugin" CACHE STRING "gRPC CPP plugin binary on host") diff --git a/examples/cpp/auth/CMakeLists.txt b/examples/cpp/auth/CMakeLists.txt index 1f28ba6bcc8..c1a97cd9f65 100644 --- a/examples/cpp/auth/CMakeLists.txt +++ b/examples/cpp/auth/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building keyvaluestore. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(Cancellation C CXX) diff --git a/examples/cpp/cancellation/CMakeLists.txt b/examples/cpp/cancellation/CMakeLists.txt index c82111b5239..e98472bba65 100644 --- a/examples/cpp/cancellation/CMakeLists.txt +++ b/examples/cpp/cancellation/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building keyvaluestore. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(Cancellation C CXX) diff --git a/examples/cpp/cmake/common.cmake b/examples/cpp/cmake/common.cmake index df9bc4db0f8..9637a2ad26c 100644 --- a/examples/cpp/cmake/common.cmake +++ b/examples/cpp/cmake/common.cmake @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building route_guide. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) if(MSVC) add_definitions(-D_WIN32_WINNT=0x600) diff --git a/examples/cpp/compression/CMakeLists.txt b/examples/cpp/compression/CMakeLists.txt index ca89acff47a..63cc4400ec4 100644 --- a/examples/cpp/compression/CMakeLists.txt +++ b/examples/cpp/compression/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(Compression C CXX) diff --git a/examples/cpp/deadline/CMakeLists.txt b/examples/cpp/deadline/CMakeLists.txt index 1cf3462e31c..e0353f26df6 100644 --- a/examples/cpp/deadline/CMakeLists.txt +++ b/examples/cpp/deadline/CMakeLists.txt @@ -16,7 +16,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building this example. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(Deadline C CXX) diff --git a/examples/cpp/error_details/CMakeLists.txt b/examples/cpp/error_details/CMakeLists.txt index 3b32bc74900..36582ce67b8 100644 --- a/examples/cpp/error_details/CMakeLists.txt +++ b/examples/cpp/error_details/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(ErrorDetails C CXX) diff --git a/examples/cpp/error_handling/CMakeLists.txt b/examples/cpp/error_handling/CMakeLists.txt index 1ae09cc8c5f..14b6414c502 100644 --- a/examples/cpp/error_handling/CMakeLists.txt +++ b/examples/cpp/error_handling/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(ErrorHandling C CXX) diff --git a/examples/cpp/flow_control/CMakeLists.txt b/examples/cpp/flow_control/CMakeLists.txt index 0d6d4353177..48c7576220d 100644 --- a/examples/cpp/flow_control/CMakeLists.txt +++ b/examples/cpp/flow_control/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building example. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(HelloWorld C CXX) diff --git a/examples/cpp/generic_api/CMakeLists.txt b/examples/cpp/generic_api/CMakeLists.txt index 44e3820f0ab..988e44ca4f3 100644 --- a/examples/cpp/generic_api/CMakeLists.txt +++ b/examples/cpp/generic_api/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(GenericAPI C CXX) diff --git a/examples/cpp/health/CMakeLists.txt b/examples/cpp/health/CMakeLists.txt index 963e82f0a3e..fc19ddb9785 100644 --- a/examples/cpp/health/CMakeLists.txt +++ b/examples/cpp/health/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(HelloWorld C CXX) diff --git a/examples/cpp/helloworld/CMakeLists.txt b/examples/cpp/helloworld/CMakeLists.txt index defe3064b14..23c7ccd9211 100644 --- a/examples/cpp/helloworld/CMakeLists.txt +++ b/examples/cpp/helloworld/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(HelloWorld C CXX) diff --git a/examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt b/examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt index 8c1218a053d..e370cc48084 100644 --- a/examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt +++ b/examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt @@ -20,7 +20,7 @@ # including the "helloworld" project itself. # See https://blog.kitware.com/cmake-superbuilds-git-submodules/ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) # Project project(HelloWorld-SuperBuild C CXX) diff --git a/examples/cpp/interceptors/CMakeLists.txt b/examples/cpp/interceptors/CMakeLists.txt index 38b7c83c570..69c64fbe2cf 100644 --- a/examples/cpp/interceptors/CMakeLists.txt +++ b/examples/cpp/interceptors/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building keyvaluestore. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(KeyValueStore C CXX) diff --git a/examples/cpp/keepalive/CMakeLists.txt b/examples/cpp/keepalive/CMakeLists.txt index 8053fba1df6..95bbaed5e6b 100644 --- a/examples/cpp/keepalive/CMakeLists.txt +++ b/examples/cpp/keepalive/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(HelloWorld C CXX) diff --git a/examples/cpp/load_balancing/CMakeLists.txt b/examples/cpp/load_balancing/CMakeLists.txt index 786a508b272..73ea0c33968 100644 --- a/examples/cpp/load_balancing/CMakeLists.txt +++ b/examples/cpp/load_balancing/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(LoadBalancing C CXX) diff --git a/examples/cpp/metadata/CMakeLists.txt b/examples/cpp/metadata/CMakeLists.txt index 7a95323b16a..36cacacd4f2 100644 --- a/examples/cpp/metadata/CMakeLists.txt +++ b/examples/cpp/metadata/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(Metadata C CXX) diff --git a/examples/cpp/multiplex/CMakeLists.txt b/examples/cpp/multiplex/CMakeLists.txt index d0b97a37f26..185e79a3965 100644 --- a/examples/cpp/multiplex/CMakeLists.txt +++ b/examples/cpp/multiplex/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(Multiplex C CXX) diff --git a/examples/cpp/otel/CMakeLists.txt b/examples/cpp/otel/CMakeLists.txt index b81a2538a89..3718b5c8ae3 100644 --- a/examples/cpp/otel/CMakeLists.txt +++ b/examples/cpp/otel/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.16) project(grpc_opentelemetry_example C CXX) diff --git a/examples/cpp/otel/codelab/CMakeLists.txt b/examples/cpp/otel/codelab/CMakeLists.txt index 6ce38d77a2f..9403822c2b7 100644 --- a/examples/cpp/otel/codelab/CMakeLists.txt +++ b/examples/cpp/otel/codelab/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.16) project(grpc_opentelemetry_example C CXX) diff --git a/examples/cpp/otel/ostream/CMakeLists.txt b/examples/cpp/otel/ostream/CMakeLists.txt index c0d9a58a988..9b37a5d19f8 100644 --- a/examples/cpp/otel/ostream/CMakeLists.txt +++ b/examples/cpp/otel/ostream/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.16) project(grpc_opentelemetry_example C CXX) diff --git a/examples/cpp/retry/CMakeLists.txt b/examples/cpp/retry/CMakeLists.txt index f01e360bb7a..b07149a2cf6 100644 --- a/examples/cpp/retry/CMakeLists.txt +++ b/examples/cpp/retry/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building retry. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(Retry C CXX) diff --git a/examples/cpp/route_guide/CMakeLists.txt b/examples/cpp/route_guide/CMakeLists.txt index 90cebda39b1..bc321a00d57 100644 --- a/examples/cpp/route_guide/CMakeLists.txt +++ b/examples/cpp/route_guide/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building route_guide. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(RouteGuide C CXX) diff --git a/examples/cpp/wait_for_ready/CMakeLists.txt b/examples/cpp/wait_for_ready/CMakeLists.txt index 06024dfbc9b..472ece2d651 100644 --- a/examples/cpp/wait_for_ready/CMakeLists.txt +++ b/examples/cpp/wait_for_ready/CMakeLists.txt @@ -17,7 +17,7 @@ # See cmake_externalproject/CMakeLists.txt for all-in-one cmake build # that automatically builds all the dependencies before building helloworld. -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) project(HelloWorld C CXX) diff --git a/src/android/test/interop/app/CMakeLists.txt b/src/android/test/interop/app/CMakeLists.txt index 403f1e518d8..83444593191 100644 --- a/src/android/test/interop/app/CMakeLists.txt +++ b/src/android/test/interop/app/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.16) set(PROTOBUF_PROTOC_EXECUTABLE "/usr/local/bin/protoc" CACHE STRING "Protoc binary on host") set(gRPC_CPP_PLUGIN_EXECUTABLE "/usr/local/bin/grpc_cpp_plugin" CACHE STRING "gRPC CPP plugin binary on host") diff --git a/src/cpp/README.md b/src/cpp/README.md index 780528b9c5e..84c19b79187 100755 --- a/src/cpp/README.md +++ b/src/cpp/README.md @@ -107,7 +107,7 @@ also sets up an `add_subdirectory()` rule for you. This causes gRPC to be built as part of your project. ```cmake -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.16) project(my_project) include(FetchContent) diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index a3e7503f373..f5b7480d639 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -275,7 +275,7 @@ protobuf_gen_files.add(src) %> - cmake_minimum_required(VERSION 3.13) + cmake_minimum_required(VERSION 3.16) set(PACKAGE_NAME "grpc") set(PACKAGE_VERSION "${settings.cpp_version}")