Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmake/fileutils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ IF(LINUX)
SET(DEPENDENCIES)
FOREACH(LINE ${OBJDUMP_OUTPUT_LIST})
STRING(REGEX MATCH
"^[ ]+NEEDED[ ]+([-_A-Za-z0-9\\.]+)" UNUSED ${LINE})
"^[ ]+NEEDED[ ]+([-+_A-Za-z0-9\\.]+)" UNUSED ${LINE})
IF(CMAKE_MATCH_1)
IF(CMAKE_MATCH_1 STREQUAL "ld-linux-x86-64.so.2" OR CMAKE_MATCH_1 STREQUAL "ld-linux-aarch64.so.1")
SET(CMAKE_MATCH_1 "libdl.so.2")
ENDIF()
LIST(APPEND DEPENDENCIES ${CMAKE_MATCH_1})
ENDIF()
ENDFOREACH()
Expand Down
16 changes: 16 additions & 0 deletions cmake/protobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,22 @@ MACRO(MYSQL_CHECK_PROTOBUF)
)
ENDIF()

# fix protobuf version 22 and up in Linux
IF(LINUX AND WITH_PROTOBUF STREQUAL "system" AND PB_MINOR_VERSION VERSION_GREATER 21)
FIND_OBJECT_DEPENDENCIES("${PROTOBUF_LIBRARY}" protobuf_dependencies)
SET_TARGET_PROPERTIES(ext::libprotobuf PROPERTIES
INTERFACE_LINK_LIBRARIES "${protobuf_dependencies}"
)
FIND_OBJECT_DEPENDENCIES("${PROTOBUF_LITE_LIBRARY}" lite_dependencies)
SET_TARGET_PROPERTIES(ext::libprotobuf-lite PROPERTIES
INTERFACE_LINK_LIBRARIES "${lite_dependencies}"
)
FIND_OBJECT_DEPENDENCIES("${Protobuf_PROTOC_LIBRARY}" protoc_dependencies)
SET_TARGET_PROPERTIES(ext::libprotoc PROPERTIES
INTERFACE_LINK_LIBRARIES "${protoc_dependencies}"
)
ENDIF()

IF("${PROTOBUF_VERSION}" VERSION_LESS "${MIN_PROTOBUF_VERSION_REQUIRED}")
COULD_NOT_FIND_PROTOBUF()
ENDIF()
Expand Down