[protobuf] Fix protobuf headers to encode dynamic/static link. Fixes #1354. Fixes #1353.

This commit is contained in:
Robert Schumacher 2017-07-07 17:51:59 -07:00
parent 596d80efb5
commit 5e45ee4a2d
2 changed files with 11 additions and 1 deletions

View File

@ -1,4 +1,4 @@
Source: protobuf
Version: 3.3.0-1
Version: 3.3.0-2
Build-Depends: zlib
Description: Protocol Buffers - Google's data interchange format

View File

@ -85,6 +85,16 @@ else()
protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin/protoc.exe)
endif()
foreach(FILE ${CURRENT_PACKAGES_DIR}/include/google/protobuf/arena.h ${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/port.h)
file(READ ${FILE} _contents)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
string(REPLACE "defined(PROTOBUF_USE_DLLS)" "1" _contents ${_contents})
else()
string(REPLACE "defined(PROTOBUF_USE_DLLS)" "0" _contents ${_contents})
endif()
file(WRITE ${FILE} ${_contents})
endforeach()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright)
file(INSTALL ${TOOL_PATH}/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
vcpkg_copy_pdbs()