mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 10:03:02 +08:00
protobuf: switching to 3.4
This commit is contained in:
parent
03edddef24
commit
a610f62587
@ -1,13 +0,0 @@
|
||||
diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h
|
||||
index 4417446..a7154b4 100644
|
||||
--- a/src/google/protobuf/generated_message_util.h
|
||||
+++ b/src/google/protobuf/generated_message_util.h
|
||||
@@ -164,7 +164,7 @@ class ExplicitlyConstructed {
|
||||
|
||||
// Default empty string object. Don't use this directly. Instead, call
|
||||
// GetEmptyString() to get the reference.
|
||||
-extern ExplicitlyConstructed< ::std::string> fixed_address_empty_string;
|
||||
+LIBPROTOBUF_EXPORT extern ExplicitlyConstructed< ::std::string> fixed_address_empty_string;
|
||||
LIBPROTOBUF_EXPORT extern ProtobufOnceType empty_string_once_init_;
|
||||
LIBPROTOBUF_EXPORT void InitEmptyString();
|
||||
|
@ -1,14 +1,13 @@
|
||||
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
|
||||
index 7618ba21..bd92b09d 100644
|
||||
index 7618ba2..d282a60 100644
|
||||
--- a/cmake/CMakeLists.txt
|
||||
+++ b/cmake/CMakeLists.txt
|
||||
@@ -165,8 +165,11 @@ endif (protobuf_UNICODE)
|
||||
@@ -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)
|
||||
@ -16,18 +15,26 @@ index 7618ba21..bd92b09d 100644
|
||||
|
||||
if (protobuf_BUILD_TESTS)
|
||||
include(tests.cmake)
|
||||
|
||||
diff --git a/cmake/install.cmake b/cmake/install.cmake
|
||||
index 28dc90dc..52c1f721 100644
|
||||
index 441bf55..4158820 100644
|
||||
--- a/cmake/install.cmake
|
||||
+++ b/cmake/install.cmake
|
||||
@@ -1,9 +1,12 @@
|
||||
@@ -1,14 +1,17 @@
|
||||
include(GNUInstallDirs)
|
||||
|
||||
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf.pc.cmake
|
||||
+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}/libprotobuf.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY)
|
||||
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake
|
||||
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libprotobuf-lite.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY)
|
||||
|
||||
foreach(_library
|
||||
- libprotobuf-lite
|
||||
- libprotobuf
|
||||
@ -36,7 +43,7 @@ index 28dc90dc..52c1f721 100644
|
||||
set_property(TARGET ${_library}
|
||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${protobuf_source_dir}/src>
|
||||
@@ -14,8 +17,10 @@ foreach(_library
|
||||
@@ -19,8 +22,10 @@ foreach(_library
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${_library})
|
||||
endforeach()
|
||||
|
||||
@ -47,9 +54,9 @@ index 28dc90dc..52c1f721 100644
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
|
||||
+endif()
|
||||
|
||||
file(STRINGS extract_includes.bat.in _extract_strings
|
||||
REGEX "^copy")
|
||||
@@ -94,7 +99,12 @@ configure_file(protobuf-options.cmake
|
||||
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.
|
||||
|
@ -1,16 +1,16 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
set(PROTOBUF_VERSION 3.3.0)
|
||||
set(PROTOBUF_VERSION 3.4.0)
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE_FILE
|
||||
URLS "https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-cpp-${PROTOBUF_VERSION}.tar.gz"
|
||||
FILENAME "protobuf-cpp-${PROTOBUF_VERSION}.tar.gz"
|
||||
SHA512 ef01300bdda4a1a33a6056aea1d55e9d66ab1ca644aa2d9d5633cfc0bccfe4c24fdfa1015889b2c1c568e89ad053c701de1aca45196a6439130b7bb8f461595f
|
||||
SHA512 ce9bd9bc818c4a8e8b08c83e8a4eba6fca008a64a5ad9d322b19683b1de2b5fa622ed99093323f3c9d0820ef23430f7ee07f6930f7f877d334e5d36df9b0be0e
|
||||
)
|
||||
vcpkg_download_distfile(TOOL_ARCHIVE_FILE
|
||||
URLS "https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-win32.zip"
|
||||
FILENAME "protoc-${PROTOBUF_VERSION}-win32.zip"
|
||||
SHA512 9b4902b3187fb978a8153aaf050314a3ca9ca161b0712a3672ccdfabb7f5a57035e71c2dfde9a0b99f9417e159dcbdedaf9a2b1917d712dc3d9d554bba0d4ee8
|
||||
SHA512 b874c3f47b39ac78f5675e05220318683004a365c248bf47ba50d8c66c8ed7763432451bab30524e131e1185a2bdaa6e6071b389eb61ad58b1b95974cf39d41b
|
||||
)
|
||||
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/protobuf-${PROTOBUF_VERSION})
|
||||
@ -23,8 +23,7 @@ vcpkg_extract_source_archive(${ARCHIVE_FILE})
|
||||
# Add a flag that can be set to disable the protobuf compiler
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/protobuf-${PROTOBUF_VERSION}
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-fix-missing-export.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/001-add-compiler-flag.patch"
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/001-add-compiler-flag.patch"
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user