Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/protobuf/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: protobuf
Version: 3.12.0-2
Version: 3.12.3
Homepage: https://github.com/google/protobuf
Description: Protocol Buffers - Google's data interchange format

Expand Down
19 changes: 10 additions & 9 deletions ports/protobuf/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO protocolbuffers/protobuf
REF v3.12.0
SHA512 2a5448651db557505ad0ad88e681b88c956de7a7b8b029f8685416629d55b09dd35a0d1219311c524b9981067c3685178d89918d4fc2540d30669e9ad0c7c2d0
REF 31ebe2ac71400344a5db91ffc13c4ddfb7589f92 #v3.12.3
SHA512 74e623547bb9448ccea29925172bf13fcbffab80eb02f58d248180000b4ae7249f0dee88bb4ef438857b0e1a96a600ab270ebf3b58568da28cbf97d8a2398297
HEAD_REF master
PATCHES
fix-uwp.patch
Expand Down Expand Up @@ -45,7 +45,6 @@ vcpkg_configure_cmake(
OPTIONS
-Dprotobuf_BUILD_SHARED_LIBS=${VCPKG_BUILD_SHARED_LIBS}
-Dprotobuf_MSVC_STATIC_RUNTIME=${VCPKG_BUILD_STATIC_CRT}
-Dprotobuf_WITH_ZLIB=${protobuf_WITH_ZLIB}
-Dprotobuf_BUILD_TESTS=OFF
-DCMAKE_INSTALL_CMAKEDIR:STRING=share/protobuf
-Dprotobuf_BUILD_PROTOC_BINARIES=${protobuf_BUILD_PROTOC_BINARIES}
Expand Down Expand Up @@ -74,9 +73,10 @@ else()
endif()

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(READ ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake RELEASE_MODULE)
string(REPLACE "\${_IMPORT_PREFIX}/bin/protoc${EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/protobuf/protoc${EXECUTABLE_SUFFIX}" RELEASE_MODULE "${RELEASE_MODULE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake "${RELEASE_MODULE}")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake
"\${_IMPORT_PREFIX}/bin/protoc${EXECUTABLE_SUFFIX}"
"\${_IMPORT_PREFIX}/tools/protobuf/protoc${EXECUTABLE_SUFFIX}"
)
endif()

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
Expand Down Expand Up @@ -114,9 +114,10 @@ else()
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_" "\#ifndef PROTOBUF_USE_DLLS\n\#define PROTOBUF_USE_DLLS\n\#endif // PROTOBUF_USE_DLLS\n\n\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" _contents "${_contents}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h "${_contents}")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h
"\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_"
"\#ifndef PROTOBUF_USE_DLLS\n\#define PROTOBUF_USE_DLLS\n\#endif // PROTOBUF_USE_DLLS\n\n\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_"
)
endif()

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
Expand Down