Skip to content
Closed
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
24 changes: 4 additions & 20 deletions ports/protobuf/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ vcpkg_from_github(
fix-default-proto-file-path.patch
)

if(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
set(protobuf_BUILD_PROTOC_BINARIES OFF)
elseif(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_IS_MINGW AND NOT (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP))
set(protobuf_BUILD_PROTOC_BINARIES OFF)
else()
set(protobuf_BUILD_PROTOC_BINARIES ON)
endif()

if(NOT protobuf_BUILD_PROTOC_BINARIES AND NOT EXISTS ${CURRENT_INSTALLED_DIR}/../x86-windows/tools/protobuf)
message(FATAL_ERROR "Cross-targetting protobuf requires the x86-windows protoc to be available. Please install protobuf:x86-windows first.")
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(VCPKG_BUILD_SHARED_LIBS ON)
else()
Expand Down Expand Up @@ -51,7 +39,7 @@ vcpkg_configure_cmake(
-Dprotobuf_MSVC_STATIC_RUNTIME=${VCPKG_BUILD_STATIC_CRT}
-Dprotobuf_BUILD_TESTS=OFF
-DCMAKE_INSTALL_CMAKEDIR:STRING=share/protobuf
-Dprotobuf_BUILD_PROTOC_BINARIES=${protobuf_BUILD_PROTOC_BINARIES}
-Dprotobuf_BUILD_PROTOC_BINARIES=ON
${FEATURE_OPTIONS}
)

Expand All @@ -70,7 +58,7 @@ endfunction()

protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/include)

if(CMAKE_HOST_WIN32)
if(VCPKG_HOST_IS_WINDOWS)
set(EXECUTABLE_SUFFIX ".exe")
else()
set(EXECUTABLE_SUFFIX "")
Expand All @@ -92,12 +80,8 @@ endif()

protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share)

if(CMAKE_HOST_WIN32)
if(protobuf_BUILD_PROTOC_BINARIES)
vcpkg_copy_tools(TOOL_NAMES protoc)
else()
file(COPY ${CURRENT_INSTALLED_DIR}/../x86-windows/tools/${PORT} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
endif()
if(VCPKG_HOST_IS_WINDOWS)
vcpkg_copy_tools(TOOL_NAMES protoc)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin)
Expand Down
8 changes: 7 additions & 1 deletion ports/protobuf/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"name": "protobuf",
"version-string": "3.14.0",
"port-version": 1,
"port-version": 2,
"description": "Protocol Buffers - Google's data interchange format",
"homepage": "https://github.com/protocolbuffers/protobuf",
"dependencies": [
{
"name": "protobuf",
"host": true
}
],
"features": {
"zlib": {
"description": "ZLib based features like Gzip streams",
Expand Down
2 changes: 1 addition & 1 deletion scripts/azure-pipelines/test-modified-ports.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ $skipList = . "$PSScriptRoot/generate-skip-list.ps1" `
# WORKAROUND: the x86-windows flavors of these are needed for all cross-compilation, but they are not auto-installed.
# Install them so the CI succeeds:
if ($Triplet -in @('x64-uwp', 'arm64-windows', 'arm-uwp')) {
.\vcpkg.exe install protobuf:x86-windows boost-build:x86-windows sqlite3:x86-windows yasm-tool:x86-windows ampl-mp:x86-windows @commonArgs
.\vcpkg.exe install boost-build:x86-windows sqlite3:x86-windows yasm-tool:x86-windows ampl-mp:x86-windows @commonArgs
} elseif ($Triplet -in @('x64-windows', 'x64-windows-static', 'x64-windows-static-md')) {
.\vcpkg.exe install yasm-tool:x86-windows @commonArgs
}
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4770,7 +4770,7 @@
},
"protobuf": {
"baseline": "3.14.0",
"port-version": 1
"port-version": 2
},
"protobuf-c": {
"baseline": "1.3.2-2",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/protobuf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "58dcf530fbf2ff03d49968a5aa76ccb53f96148f",
"version-string": "3.14.0",
"port-version": 2
},
{
"git-tree": "2a90dca85ce43bc6cb008cce7d6706e319bc645b",
"version-string": "3.14.0",
Expand Down