Skip to content

Commit

Permalink
[dbus] add absl support for higher version protobuf
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 committed Dec 21, 2023
1 parent 45d69b4 commit ead2c64
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 @@ -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)
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 ead2c64

Please sign in to comment.