[protobuf-c] Update to 1.5.0 (#39878)

Co-authored-by: Monica <v-liumonica@microsoft.com>
This commit is contained in:
MonicaLiu 2024-08-01 09:57:53 -07:00 committed by GitHub
parent 7516a02de0
commit 682f633501
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 53 additions and 7 deletions

View File

@ -1,8 +1,21 @@
diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt
index 98b51eb..0243b80 100644
--- a/build-cmake/CMakeLists.txt
+++ b/build-cmake/CMakeLists.txt
@@ -70,7 +70,7 @@ if (BUILD_PROTO3)
endif()
@@ -66,11 +66,6 @@ if(MSVC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267 /wd4244")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4244")
- # Allow matching protobuf runtime dependency
- if(NOT BUILD_SHARED_LIBS)
- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
- endif(NOT BUILD_SHARED_LIBS)
-
ENDIF()
get_filename_component(MAIN_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH)
@@ -103,7 +98,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # for generated files
ENDIF()
-if (MSVC AND NOT BUILD_SHARED_LIBS)
@ -10,3 +23,12 @@ diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt
# In case we are building static libraries, link also the runtime library statically
# so that MSVCR*.DLL is not required at runtime.
# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
@@ -118,7 +113,7 @@ if (MSVC AND NOT BUILD_SHARED_LIBS)
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
-endif (MSVC AND NOT BUILD_SHARED_LIBS)
+endif ()
if(WIN32)
# Modify the environment to hint protoc where the plugin is

View File

@ -0,0 +1,13 @@
diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt
index ba0b730..a5161cf 100644
--- a/build-cmake/CMakeLists.txt
+++ b/build-cmake/CMakeLists.txt
@@ -15,7 +15,7 @@ if (MSVC AND NOT BUILD_SHARED_LIBS)
SET(Protobuf_USE_STATIC_LIBS ON)
endif (MSVC AND NOT BUILD_SHARED_LIBS)
-FIND_PACKAGE(Protobuf REQUIRED)
+find_package(protobuf CONFIG REQUIRED)
file(REAL_PATH "${PROTOBUF_INCLUDE_DIR}" PROTOBUF_INCLUDE_DIR)
INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR})

View File

@ -2,10 +2,11 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO protobuf-c/protobuf-c
REF v${VERSION}
SHA512 57f858118a89befc80e111ad9a57eadbcf2317d60e085b6d99e10f6604ee8c08473fe6ab1fdfb0a3196821a6e68e743943338321d23d15a1229987f140341181
SHA512 4c540ca58b65e59aaf7149124d915f106e91fc79d60c6ef80b62faf288843250375e13f8773fd24f2ff27485dc2d2e597f0a95e39c186a30069eb470abd28ae7
HEAD_REF master
PATCHES
fix-crt-linkage.patch
fix-dependency-protobuf.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
@ -31,6 +32,8 @@ if("tools" IN_LIST FEATURES)
)
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/protobuf-c")
# Include files should not be duplicated into the /debug/include directory.
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

View File

@ -1,7 +1,6 @@
{
"name": "protobuf-c",
"version-semver": "1.4.1",
"port-version": 1,
"version-semver": "1.5.0",
"description": "This is protobuf-c, a C implementation of the Google Protocol Buffers data serialization format.",
"homepage": "https://github.com/protobuf-c/protobuf-c",
"dependencies": [
@ -9,6 +8,10 @@
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {

View File

@ -7089,8 +7089,8 @@
"port-version": 0
},
"protobuf-c": {
"baseline": "1.4.1",
"port-version": 1
"baseline": "1.5.0",
"port-version": 0
},
"protopuf": {
"baseline": "2.2.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c01ef23feaae3b86482f38e6da87a147b4f2dd11",
"version-semver": "1.5.0",
"port-version": 0
},
{
"git-tree": "32d120b5b3a9225b973b135f632ee82be3e7860b",
"version-semver": "1.4.1",