1 Star 0 Fork 55

liuhaofeng/mysql

forked from src-openEuler/mysql 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-protobuf-version-22-and-up.patch 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
From 7e252db5027c0dddb4c5a403ba0a481c35c10283 Mon Sep 17 00:00:00 2001
From: gordonwwang <gordonwwang@tencent.com>
Date: Sun, 18 Feb 2024 14:27:33 +0800
Subject: [PATCH] Fix build failure with Protobuf-24.2
---
cmake/fileutils.cmake | 5 ++++-
cmake/protobuf.cmake | 16 ++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/cmake/fileutils.cmake b/cmake/fileutils.cmake
index da98301..22dfb8d 100644
--- a/cmake/fileutils.cmake
+++ b/cmake/fileutils.cmake
@@ -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" OR CMAKE_MATCH_1 STREQUAL "ld-linux-riscv64-lp64d.so.1")
+ SET(CMAKE_MATCH_1 "libdl.so.2")
+ ENDIF()
LIST(APPEND DEPENDENCIES ${CMAKE_MATCH_1})
ENDIF()
ENDFOREACH()
diff --git a/cmake/protobuf.cmake b/cmake/protobuf.cmake
index 11c0f92..447ce6c 100644
--- a/cmake/protobuf.cmake
+++ b/cmake/protobuf.cmake
@@ -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()
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kkhome1/mysql.git
git@gitee.com:kkhome1/mysql.git
kkhome1
mysql
mysql
master

搜索帮助