diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dce8909ef883..6ed127262620 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,7 +68,7 @@ jobs: sudo apt-get update sudo apt-get install build-essential ffmpeg - sudo apt-get install -y ca-certificates cmake curl patch libabsl-dev protobuf-compiler-grpc grpc-proto libprotobuf-dev protobuf-compiler + sudo apt-get install -y ca-certificates cmake curl patch libabsl-dev libprotobuf-dev protobuf-compiler sudo apt-get install -y libopencv-dev && sudo ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2 sudo pip install -r extra/requirements.txt diff --git a/backend/cpp/llama/CMakeLists.txt b/backend/cpp/llama/CMakeLists.txt index 7849056bf1d9..50a0adfd46fa 100644 --- a/backend/cpp/llama/CMakeLists.txt +++ b/backend/cpp/llama/CMakeLists.txt @@ -1,15 +1,27 @@ set(CMAKE_CXX_STANDARD 17) - +cmake_minimum_required(VERSION 3.15) set(TARGET grpc-server) set(_PROTOBUF_LIBPROTOBUF libprotobuf) set(_REFLECTION grpc++_reflection) -# find_package(Protobuf CONFIG REQUIRED) is not working, see: -# https://gitlab.kitware.com/cmake/cmake/-/issues/24321 -set(CMAKE_FIND_PACKAGE_PREFER_CONFIG 1) +option(USE_SYSTEM_GRPC "Use system installed gRPC" OFF) + +if(USE_SYSTEM_GRPC) + # Find system-installed gRPC + find_package(gRPC CONFIG REQUIRED) +else() + include(FetchContent) + FetchContent_Declare( + gRPC + GIT_REPOSITORY https://github.com/grpc/grpc + GIT_TAG v1.58.0 + ) + set(FETCHCONTENT_QUIET OFF) + FetchContent_MakeAvailable(gRPC) +endif() + find_package(Protobuf CONFIG REQUIRED) find_package(absl CONFIG REQUIRED) -find_package(gRPC CONFIG REQUIRED) find_program(_PROTOBUF_PROTOC protoc) set(_GRPC_GRPCPP grpc++)