Skip to content

Commit

Permalink
[dbus] add absl support for higher version protobuf (#2130)
Browse files Browse the repository at this point in the history
Protobuf which higher than 22 need link absl. Add the linked shared
library to pass the build.

Signed-off-by: Haoran Wang <[email protected]>
  • Loading branch information
TE-N-ElvenWang authored Feb 1, 2024
1 parent 9f770e9 commit afe85cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()
find_package(Protobuf REQUIRED)

# Protobuf library which >= 4.22 requires to link the absl
if ("${Protobuf_VERSION}" VERSION_GREATER_EQUAL 4.22)
find_package(absl REQUIRED)
set(ABSL_LIBS absl::log_internal_check_op)
endif()

# Set up the output path.
set(PROTO_GEN_DIR ${PROJECT_SOURCE_DIR}/build/src/proto)
if(NOT (EXISTS "${PROTO_GEN_DIR}" AND IS_DIRECTORY "${PROTO_GEN_DIR}"))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit afe85cc

Please sign in to comment.