From ead2c6419bcbc6d23fdc6b2db5fdba99455d427d Mon Sep 17 00:00:00 2001 From: Haoran Wang Date: Tue, 12 Dec 2023 20:56:22 +0800 Subject: [PATCH] [dbus] add absl support for higher version protobuf Protobuf which higher than 22 need link absl. Add the linked shared library to pass the build. Signed-off-by: Haoran Wang --- src/proto/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/proto/CMakeLists.txt b/src/proto/CMakeLists.txt index e982d52aa90..f9e1461df2b 100644 --- a/src/proto/CMakeLists.txt +++ b/src/proto/CMakeLists.txt @@ -7,6 +7,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") list(APPEND CMAKE_PREFIX_PATH "${Protobuf_PREFIX_PATH}") endif() find_package(Protobuf REQUIRED) +if ("${Protobuf_VERSION}" MATCHES [[[0-9]+.([0-9]+).[0-9]+]]) + if(CMAKE_MATCH_1 GREATER_EQUAL 22) + find_package(absl REQUIRED) + set(ABSL_LIBS absl::log_internal_check_op) + endif() +endif() # Set up the output path. set(PROTO_GEN_DIR ${PROJECT_SOURCE_DIR}/build/src/proto) @@ -61,6 +67,7 @@ find_package(Protobuf REQUIRED) target_link_libraries(otbr-proto PUBLIC protobuf::libprotobuf-lite + ${ABSL_LIBS} ) target_include_directories(otbr-proto PUBLIC