diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2020-12-28 13:19:50 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-28 13:19:50 -0800 |
| commit | 59c519f93bb99b8ce01930b0acebafb34db78832 (patch) | |
| tree | 47805fbf8680d0e986c54c6625af4b7d12c24745 | |
| parent | bba1522d76dee593f039b99a0f24cf4fb6adc118 (diff) | |
| download | vcpkg-59c519f93bb99b8ce01930b0acebafb34db78832.tar.gz vcpkg-59c519f93bb99b8ce01930b0acebafb34db78832.zip | |
[protobuf] Fix the default proto file path (#15246)
| -rw-r--r-- | ports/protobuf/CONTROL | 1 | ||||
| -rw-r--r-- | ports/protobuf/fix-default-proto-file-path.patch | 20 | ||||
| -rw-r--r-- | ports/protobuf/portfile.cmake | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index 7d67ac742..967503724 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,5 +1,6 @@ Source: protobuf Version: 3.14.0 +Port-Version: 1 Homepage: https://github.com/protocolbuffers/protobuf Description: Protocol Buffers - Google's data interchange format diff --git a/ports/protobuf/fix-default-proto-file-path.patch b/ports/protobuf/fix-default-proto-file-path.patch new file mode 100644 index 000000000..a5af918b3 --- /dev/null +++ b/ports/protobuf/fix-default-proto-file-path.patch @@ -0,0 +1,20 @@ +diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc +index f192ae6..22900ed 100644 +--- a/src/google/protobuf/compiler/command_line_interface.cc ++++ b/src/google/protobuf/compiler/command_line_interface.cc +@@ -260,11 +260,15 @@ void AddDefaultProtoPaths( + return; + } + // Check if the upper level directory has an "include" subdirectory. ++ // change "'$/bin' is next to 'include'" assumption to "'$/bin/tools' is next to 'include'" ++ for (int i = 0; i < 2; i++) ++ { + pos = path.find_last_of("/\\"); + if (pos == std::string::npos || pos == 0) { + return; + } + path = path.substr(0, pos); ++ } + if (IsInstalledProtoPath(path + "/include")) { + paths->push_back( + std::pair<std::string, std::string>("", path + "/include")); diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index d364878db..a79a34ef8 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-static-build.patch + fix-default-proto-file-path.patch ) if(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x86") |
