Skip to content

Commit

Permalink
try fix protobuf on cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler committed Oct 13, 2023
1 parent 15d5ab4 commit a9b1014
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 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
Expand Down
7 changes: 6 additions & 1 deletion backend/cpp/llama/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ set(_PROTOBUF_LIBPROTOBUF libprotobuf)
set(_REFLECTION grpc++_reflection)

find_package(absl REQUIRED)
find_package(Protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
find_program(_PROTOBUF_PROTOC protoc)
set(_GRPC_GRPCPP grpc++)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)

# find_package(Protobuf CONFIG REQUIRED) is not working, see:
# https://gitlab.kitware.com/cmake/cmake/-/issues/24321
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG 1)
find_package(Protobuf)

include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${Protobuf_INCLUDE_DIRS})

Expand Down

0 comments on commit a9b1014

Please sign in to comment.