mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 08:23:07 +08:00
[protobuf] Update to 3.6.1
This commit is contained in:
parent
f14a6e79b3
commit
e3dc99e22b
@ -1,70 +0,0 @@
|
|||||||
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
|
|
||||||
index 7618ba2..d282a60 100644
|
|
||||||
--- a/cmake/CMakeLists.txt
|
|
||||||
+++ b/cmake/CMakeLists.txt
|
|
||||||
@@ -165,8 +165,10 @@ endif (protobuf_UNICODE)
|
|
||||||
|
|
||||||
include(libprotobuf-lite.cmake)
|
|
||||||
include(libprotobuf.cmake)
|
|
||||||
-include(libprotoc.cmake)
|
|
||||||
-include(protoc.cmake)
|
|
||||||
+if(protobuf_BUILD_COMPILER)
|
|
||||||
+ include(libprotoc.cmake)
|
|
||||||
+ include(protoc.cmake)
|
|
||||||
+endif()
|
|
||||||
|
|
||||||
if (protobuf_BUILD_TESTS)
|
|
||||||
include(tests.cmake)
|
|
||||||
|
|
||||||
diff --git a/cmake/install.cmake b/cmake/install.cmake
|
|
||||||
index 441bf55..20b3aa0 100644
|
|
||||||
--- a/cmake/install.cmake
|
|
||||||
+++ b/cmake/install.cmake
|
|
||||||
@@ -1,14 +1,17 @@
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
|
|
||||||
+set(LIBRARIES_TO_SET_DEST libprotobuf-lite libprotobuf)
|
|
||||||
+if(protobuf_BUILD_COMPILER)
|
|
||||||
+ list(APPEND LIBRARIES_TO_SET_DEST libprotoc)
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf.pc.cmake
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY)
|
|
||||||
|
|
||||||
foreach(_library
|
|
||||||
- libprotobuf-lite
|
|
||||||
- libprotobuf
|
|
||||||
- libprotoc)
|
|
||||||
+ ${LIBRARIES_TO_SET_DEST})
|
|
||||||
set_property(TARGET ${_library}
|
|
||||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
|
||||||
$<BUILD_INTERFACE:${protobuf_source_dir}/src>
|
|
||||||
@@ -19,8 +22,10 @@ foreach(_library
|
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${_library})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
-install(TARGETS protoc EXPORT protobuf-targets
|
|
||||||
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
|
|
||||||
+if(protobuf_BUILD_COMPILER)
|
|
||||||
+ install(TARGETS protoc EXPORT protobuf-targets
|
|
||||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
|
|
||||||
+endif()
|
|
||||||
|
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
|
||||||
|
|
||||||
@@ -101,7 +106,12 @@ configure_file(protobuf-options.cmake
|
|
||||||
${CMAKE_INSTALL_CMAKEDIR}/protobuf-options.cmake @ONLY)
|
|
||||||
|
|
||||||
# Allows the build directory to be used as a find directory.
|
|
||||||
-export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc
|
|
||||||
+set(FIND_DIRS libprotobuf-lite libprotobuf)
|
|
||||||
+if(protobuf_BUILD_COMPILER)
|
|
||||||
+ list(APPEND FIND_DIRS libprotoc protoc)
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
+export(TARGETS ${FIND_DIRS}
|
|
||||||
NAMESPACE protobuf::
|
|
||||||
FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake
|
|
||||||
)
|
|
@ -1,5 +1,5 @@
|
|||||||
Source: protobuf
|
Source: protobuf
|
||||||
Version: 3.6.0.1
|
Version: 3.6.1-1
|
||||||
Description: Protocol Buffers - Google's data interchange format
|
Description: Protocol Buffers - Google's data interchange format
|
||||||
|
|
||||||
Feature: zlib
|
Feature: zlib
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
diff --git a/src/google/protobuf/compiler/code_generator.h b/src/google/protobuf/compiler/code_generator.h
|
|
||||||
index 4b1d90b..4c2b3ee 100644
|
|
||||||
--- a/src/google/protobuf/compiler/code_generator.h
|
|
||||||
+++ b/src/google/protobuf/compiler/code_generator.h
|
|
||||||
@@ -166,7 +166,7 @@ typedef GeneratorContext OutputDirectory;
|
|
||||||
// "foo=bar,baz,qux=corge"
|
|
||||||
// parses to the pairs:
|
|
||||||
// ("foo", "bar"), ("baz", ""), ("qux", "corge")
|
|
||||||
-void ParseGeneratorParameter(
|
|
||||||
+LIBPROTOC_EXPORT void ParseGeneratorParameter(
|
|
||||||
const string&, std::vector<std::pair<string, string> >*);
|
|
||||||
|
|
||||||
} // namespace compiler
|
|
@ -1,25 +0,0 @@
|
|||||||
diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake
|
|
||||||
index 107c1c5..233bcf6 100644
|
|
||||||
--- a/cmake/libprotoc.cmake
|
|
||||||
+++ b/cmake/libprotoc.cmake
|
|
||||||
@@ -73,7 +73,7 @@ set(libprotoc_files
|
|
||||||
${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field.cc
|
|
||||||
${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field_lite.cc
|
|
||||||
${protobuf_source_dir}/src/google/protobuf/compiler/js/js_generator.cc
|
|
||||||
- ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
|
|
||||||
+ ${CMAKE_CURRENT_BINARY_DIR}/well_known_types_embed.cc
|
|
||||||
${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum.cc
|
|
||||||
${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
|
|
||||||
${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_extension.cc
|
|
||||||
@@ -210,9 +210,9 @@ set(js_well_known_types_sources
|
|
||||||
)
|
|
||||||
add_executable(js_embed ${protobuf_source_dir}/src/google/protobuf/compiler/js/embed.cc)
|
|
||||||
add_custom_command(
|
|
||||||
- OUTPUT ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
|
|
||||||
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/well_known_types_embed.cc
|
|
||||||
DEPENDS js_embed ${js_well_known_types_sources}
|
|
||||||
- COMMAND js_embed ${js_well_known_types_sources} > ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
|
|
||||||
+ COMMAND "$<TARGET_FILE:js_embed>" ${js_well_known_types_sources} > ${CMAKE_CURRENT_BINARY_DIR}/well_known_types_embed.cc
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(libprotoc ${protobuf_SHARED_OR_STATIC}
|
|
@ -3,11 +3,10 @@ include(vcpkg_common_functions)
|
|||||||
vcpkg_from_github(
|
vcpkg_from_github(
|
||||||
OUT_SOURCE_PATH SOURCE_PATH
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
REPO google/protobuf
|
REPO google/protobuf
|
||||||
REF v3.6.0.1
|
REF v3.6.1
|
||||||
SHA512 63cd799d5d6edbb05a87bc07992271c5bdb9595366d698b4dc5476cc89dc278d1c43186b9e56340958aefea2ce23e15a9c3a550158414add868b56e789ceafe4
|
SHA512 1bc175d24b49de1b1e41eaf39598194e583afffb924c86c8d2e569d935af21874be76b2cbd4d9655a1d38bac3d4cd811de88bc2c72d81bad79115e69e5b0d839
|
||||||
HEAD_REF master
|
HEAD_REF master
|
||||||
PATCHES
|
PATCHES
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/js-embed.patch"
|
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/fix-uwp.patch"
|
"${CMAKE_CURRENT_LIST_DIR}/fix-uwp.patch"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
From 24493eef9395e5b832360e12efabf9c363c9cb15 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Rodrigo Hernandez <kwizatz@aeongames.com>
|
|
||||||
Date: Mon, 4 Dec 2017 19:04:42 -0600
|
|
||||||
Subject: [PATCH] Using binary one's complement to negate an unsigned int
|
|
||||||
|
|
||||||
This removes a Visual Studio warning:
|
|
||||||
|
|
||||||
warning C4146: unary minus operator applied to unsigned type, result
|
|
||||||
still unsigned.
|
|
||||||
---
|
|
||||||
src/google/protobuf/wire_format_lite.h | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/google/protobuf/wire_format_lite.h b/src/google/protobuf/wire_format_lite.h
|
|
||||||
index cf614c02a4..361920b8ec 100644
|
|
||||||
--- a/src/google/protobuf/wire_format_lite.h
|
|
||||||
+++ b/src/google/protobuf/wire_format_lite.h
|
|
||||||
@@ -860,7 +860,7 @@ inline uint32 WireFormatLite::ZigZagEncode32(int32 n) {
|
|
||||||
|
|
||||||
inline int32 WireFormatLite::ZigZagDecode32(uint32 n) {
|
|
||||||
// Note: Using unsigned types prevent undefined behavior
|
|
||||||
- return static_cast<int32>((n >> 1) ^ -(n & 1));
|
|
||||||
+ return static_cast<int32>((n >> 1) ^ (~(n & 1) + 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
inline uint64 WireFormatLite::ZigZagEncode64(int64 n) {
|
|
||||||
@@ -871,7 +871,7 @@ inline uint64 WireFormatLite::ZigZagEncode64(int64 n) {
|
|
||||||
|
|
||||||
inline int64 WireFormatLite::ZigZagDecode64(uint64 n) {
|
|
||||||
// Note: Using unsigned types prevent undefined behavior
|
|
||||||
- return static_cast<int64>((n >> 1) ^ -(n & 1));
|
|
||||||
+ return static_cast<int64>((n >> 1) ^ (~(n & 1) + 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
// String is for UTF-8 text only, but, even so, ReadString() can simply
|
|
Loading…
Reference in New Issue
Block a user