From 8045fcfb3765698d8cc3f07186fcc29d6702ee71 Mon Sep 17 00:00:00 2001
From: jake <jikai11@huawei.com>
Date: Thu, 30 Nov 2023 11:58:47 +0000
Subject: [PATCH 44/65] !2289 check protobuf and grpc version in cmake for cri
 v1 * check protobuf and grpc version in cmake for cri v1

---
 cmake/checker.cmake | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/cmake/checker.cmake b/cmake/checker.cmake
index cc4a1fc3..e19618e4 100644
--- a/cmake/checker.cmake
+++ b/cmake/checker.cmake
@@ -125,7 +125,11 @@ endif()
 
 if (GRPC_CONNECTOR)
     # check protobuf
-    pkg_check_modules(PC_PROTOBUF "protobuf>=3.1.0")
+    if (ENABLE_CRI_API_V1)
+        pkg_check_modules(PC_PROTOBUF "protobuf>=3.14.0")
+    else()
+        pkg_check_modules(PC_PROTOBUF "protobuf>=3.1.0")
+    endif()
     find_library(PROTOBUF_LIBRARY protobuf
         HINTS ${PC_PROTOBUF_LIBDIR} ${PC_PROTOBUF_LIBRARY_DIRS})
     _CHECK(PROTOBUF_LIBRARY "PROTOBUF_LIBRARY-NOTFOUND" "libprotobuf.so")
@@ -136,6 +140,9 @@ if (GRPC_CONNECTOR)
     _CHECK(CMD_GRPC_CPP_PLUGIN "CMD_GRPC_CPP_PLUGIN-NOTFOUND" "grpc_cpp_plugin")
 
     # check grpc
+    if (ENABLE_CRI_API_V1)
+        pkg_check_modules(PC_GRPC++ "grpc++>=1.41.0")
+    endif()
     find_path(GRPC_INCLUDE_DIR grpc/grpc.h)
     _CHECK(GRPC_INCLUDE_DIR "GRPC_INCLUDE_DIR-NOTFOUND" "grpc/grpc.h")
     find_library(GRPC_PP_REFLECTION_LIBRARY grpc++_reflection)
-- 
2.42.0

