From 121f0b074bc2626917eb9f0132394daa211831ab Mon Sep 17 00:00:00 2001 From: ffacs Date: Fri, 22 Mar 2024 00:19:25 +0800 Subject: [PATCH 1/3] [C++] Upgrade protobuf to 3.21.12 --- cmake_modules/ThirdpartyToolchain.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake index a130b7dfee..fac13d10ab 100644 --- a/cmake_modules/ThirdpartyToolchain.cmake +++ b/cmake_modules/ThirdpartyToolchain.cmake @@ -26,7 +26,7 @@ set(LZ4_VERSION "1.10.0") set(SNAPPY_VERSION "1.2.2") set(ZLIB_VERSION "1.3.1") set(GTEST_VERSION "1.17.0") -set(PROTOBUF_VERSION "3.5.1") +set(PROTOBUF_VERSION "3.21.12") set(ZSTD_VERSION "1.5.7") set(SPARSEHASH_VERSION "2.11.1") From 2486de0ee839a91e48c16896a9053b26b33e7986 Mon Sep 17 00:00:00 2001 From: ffacs Date: Tue, 24 Feb 2026 20:09:51 +0800 Subject: [PATCH 2/3] [C++] Fix vendored Protobuf target conflicts for version >= 3.21 Guard alias creation for protobuf::libprotobuf and protobuf::protoc to avoid duplicate target errors when Protobuf >= 3.21 already exports them. Also mark protobuf headers as SYSTEM to suppress compiler warnings from protobuf code. Co-authored-by: Cursor --- cmake_modules/ThirdpartyToolchain.cmake | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake index fac13d10ab..9445060b9e 100644 --- a/cmake_modules/ThirdpartyToolchain.cmake +++ b/cmake_modules/ThirdpartyToolchain.cmake @@ -219,8 +219,24 @@ else () if(protobuf_SOURCE_DIR) message(STATUS "Using vendored Protobuf") - add_library(protobuf::libprotobuf ALIAS libprotobuf) - add_executable(protobuf::protoc ALIAS protoc) + # Protobuf >= 3.21 exports protobuf::libprotobuf/protobuf::protoc itself. + # Guard alias creation to avoid duplicate target errors. + if(TARGET libprotobuf AND NOT TARGET protobuf::libprotobuf) + add_library(protobuf::libprotobuf ALIAS libprotobuf) + endif() + if(TARGET protoc AND NOT TARGET protobuf::protoc) + add_executable(protobuf::protoc ALIAS protoc) + endif() + + # Avoid exporting build/source paths in install interface. + # Mark as SYSTEM so compiler suppresses warnings from protobuf headers + # (e.g. -Wunused-parameter) without affecting ORC's own code. + if(TARGET libprotobuf) + set_property(TARGET libprotobuf PROPERTY INTERFACE_INCLUDE_DIRECTORIES) + target_include_directories(libprotobuf SYSTEM INTERFACE + "$" + "$") + endif() if(BUILD_POSITION_INDEPENDENT_LIB) set_target_properties(libprotobuf PROPERTIES POSITION_INDEPENDENT_CODE ON) From 91a336aade06257988c5475496430440f88cb35d Mon Sep 17 00:00:00 2001 From: ffacs Date: Tue, 24 Feb 2026 20:25:51 +0800 Subject: [PATCH 3/3] [C++] Bump meson protobuf wrap from 3.5.1 to 3.21.12 Align the meson build protobuf version with the CMake build (3.21.12) using the latest wrapdb patch (3.21.12-5). Co-authored-by: Cursor --- subprojects/protobuf.wrap | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/subprojects/protobuf.wrap b/subprojects/protobuf.wrap index edf6135492..70febecb55 100644 --- a/subprojects/protobuf.wrap +++ b/subprojects/protobuf.wrap @@ -16,10 +16,18 @@ # under the License. [wrap-file] -directory = protobuf-3.5.1 -source_url = https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-all-3.5.1.tar.gz -source_filename = protobuf-all-3.5.1.tar.gz -source_hash = 72d43863f58567a9ea2054671fdb667867f9cf7865df623c7be630978ff97dff -patch_url = https://wrapdb.mesonbuild.com/v2/protobuf_3.5.1-3/get_patch -patch_filename = protobuf-3.5.1-3-wrap.zip -patch_hash = 9316ee29244a590545d8175136fd916149ca81e3f33f20d3cffc5bd3e6812e67 +directory = protobuf-3.21.12 +source_url = https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.12.tar.gz +source_filename = protobuf-3.21.12.tar.gz +source_hash = 930c2c3b5ecc6c9c12615cf5ad93f1cd6e12d0aba862b572e076259970ac3a53 +patch_filename = protobuf_3.21.12-5_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/protobuf_3.21.12-5/get_patch +patch_hash = 8ae4d39ca9748a6edf7e028e15f5c7499b1c6ce687454a5709711d47cfd4e293 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/protobuf_3.21.12-5/protobuf-3.21.12.tar.gz +wrapdb_version = 3.21.12-5 + +[provide] +protobuf = protobuf_dep +protobuf-lite = protobuf_lite_dep +protoc = protoc_dep +program_names = protoc