aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-10-17 00:22:35 -0700
committerRobert Schumacher <roschuma@microsoft.com>2018-10-17 04:38:15 -0700
commite7a37f14a82aaead89447c029f62c3427e07373c (patch)
tree0b988c0aad9a47549b39c12d07c556fbce75cbaf
parent611b87955b0c53b9dac2fd1399ffddfb90d7bb17 (diff)
downloadvcpkg-e7a37f14a82aaead89447c029f62c3427e07373c.tar.gz
vcpkg-e7a37f14a82aaead89447c029f62c3427e07373c.zip
[protobuf] Disable building the lite runtime. Resolves https://github.com/protocolbuffers/protobuf/issues/4925.
-rw-r--r--ports/protobuf/CONTROL2
-rw-r--r--ports/protobuf/disable-lite.patch41
-rw-r--r--ports/protobuf/portfile.cmake7
3 files changed, 48 insertions, 2 deletions
diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL
index 3c480a1e4..c2be8e0f3 100644
--- a/ports/protobuf/CONTROL
+++ b/ports/protobuf/CONTROL
@@ -1,5 +1,5 @@
Source: protobuf
-Version: 3.6.1-2
+Version: 3.6.1-4
Description: Protocol Buffers - Google's data interchange format
Feature: zlib
diff --git a/ports/protobuf/disable-lite.patch b/ports/protobuf/disable-lite.patch
new file mode 100644
index 000000000..ceb34671c
--- /dev/null
+++ b/ports/protobuf/disable-lite.patch
@@ -0,0 +1,41 @@
+diff --git a/cmake/install.cmake b/cmake/install.cmake
+index 82036cb..378db2d 100644
+--- a/cmake/install.cmake
++++ b/cmake/install.cmake
+@@ -15,10 +15,12 @@ foreach(_library ${_protobuf_libraries})
+ PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+ $<BUILD_INTERFACE:${protobuf_source_dir}/src>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
++ if(NOT "${_library}" STREQUAL "libprotobuf-lite")
+ install(TARGETS ${_library} EXPORT protobuf-targets
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${_library}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${_library}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${_library})
++ endif()
+ endforeach()
+
+ if (protobuf_BUILD_PROTOC_BINARIES)
+@@ -26,7 +28,7 @@ if (protobuf_BUILD_PROTOC_BINARIES)
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
+ endif (protobuf_BUILD_PROTOC_BINARIES)
+
+-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+
+ file(STRINGS extract_includes.bat.in _extract_strings
+ REGEX "^copy")
+@@ -107,12 +109,12 @@ configure_file(protobuf-options.cmake
+ # Allows the build directory to be used as a find directory.
+
+ if (protobuf_BUILD_PROTOC_BINARIES)
+- export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc
++ export(TARGETS libprotobuf libprotoc protoc
+ NAMESPACE protobuf::
+ FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake
+ )
+ else (protobuf_BUILD_PROTOC_BINARIES)
+- export(TARGETS libprotobuf-lite libprotobuf
++ export(TARGETS libprotobuf
+ NAMESPACE protobuf::
+ FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake
+ )
diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake
index 37919a820..1dc7e6cf5 100644
--- a/ports/protobuf/portfile.cmake
+++ b/ports/protobuf/portfile.cmake
@@ -7,7 +7,8 @@ vcpkg_from_github(
SHA512 1bc175d24b49de1b1e41eaf39598194e583afffb924c86c8d2e569d935af21874be76b2cbd4d9655a1d38bac3d4cd811de88bc2c72d81bad79115e69e5b0d839
HEAD_REF master
PATCHES
- "${CMAKE_CURRENT_LIST_DIR}/fix-uwp.patch"
+ fix-uwp.patch
+ disable-lite.patch
)
if(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
@@ -110,6 +111,10 @@ else()
protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin)
endif()
+if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/libprotobuf-lite.lib)
+ message(FATAL_ERROR "Expected to not build the lite runtime because it contains some of the same symbols as the full runtime.")
+endif()
+
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(READ ${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h _contents)
string(REPLACE "\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" "\#define PROTOBUF_USE_DLLS\n\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" _contents "${_contents}")