[protobuf] Disable building the lite runtime. Resolves https://github.com/protocolbuffers/protobuf/issues/4925.

This commit is contained in:
Robert Schumacher 2018-10-17 00:22:35 -07:00
parent 611b87955b
commit e7a37f14a8
3 changed files with 48 additions and 2 deletions

View File

@ -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

View File

@ -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
)

View File

@ -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}")