Skip to content

Commit

Permalink
CMake: Fix linking with private abseil-cpp libraries
Browse files Browse the repository at this point in the history
This fixes the following linking errors

vendor/libliblpdump.a(dynamic_partitions_device_info.pb.cc.o):
undefined reference to symbol '_ZN4absl12lts_2023012512log_internal21CheckOpMessageBuilder7ForVar2Ev'
/usr/lib/libabsl_log_internal_check_op.so.2301.0.0: error adding symbols: DSO missing from command line

The find_package was called twice because protobuf-config.cmake file
was not present in versions older than 22.0. Also the Config mode is
required to get the private abseil-cpp libraries.
  • Loading branch information
Biswa96 committed Jul 7, 2023
1 parent c5eae90 commit 16cba04
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vendor/CMakeLists.adb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ target_link_libraries(adb
libzip
crypto
ssl
${PROTOBUF_LIBRARIES}
protobuf::libprotobuf
PkgConfig::libbrotlicommon
PkgConfig::libbrotlidec
PkgConfig::libbrotlienc
Expand Down
2 changes: 1 addition & 1 deletion vendor/CMakeLists.partition.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ add_library(liblpdump STATIC
${DYNAMIC_PARTITIONS_DEVICE_INFO_PROTO_SRCS} ${DYNAMIC_PARTITIONS_DEVICE_INFO_PROTO_HDRS}
extras/partition_tools/lpdump.cc)
target_link_libraries(liblpdump PRIVATE
libbase libjsonpbparse liblp ${PROTOBUF_LIBRARIES})
libbase libjsonpbparse liblp protobuf::libprotobuf)

add_executable(lpdump
extras/partition_tools/lpdump_host.cc)
Expand Down
1 change: 1 addition & 0 deletions vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pkg_check_modules(libpcre2-8 REQUIRED IMPORTED_TARGET libpcre2-8)
pkg_check_modules(libusb-1.0 REQUIRED IMPORTED_TARGET libusb-1.0)
pkg_check_modules(libzstd REQUIRED IMPORTED_TARGET libzstd)

find_package(Protobuf CONFIG)
find_package(Protobuf REQUIRED)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
Expand Down

0 comments on commit 16cba04

Please sign in to comment.