-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protobuf/grpc PR #88
Merged
Merged
Protobuf/grpc PR #88
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Source: grpc | ||
Version: 1.1.0-dev-1674f65 | ||
Build-Depends: zlib, openssl, protobuf | ||
Description: An RPC library and framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
include(vcpkg_common_functions) | ||
find_program(GIT git) | ||
|
||
set(GIT_URL "https://github.com/grpc/grpc.git") | ||
set(GIT_REV "1674f650ad9411448a35b7c19c5dbdaf0ebd8916") | ||
|
||
if(NOT EXISTS "${DOWNLOADS}/grpc.git") | ||
message(STATUS "Cloning") | ||
vcpkg_execute_required_process( | ||
COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/grpc.git | ||
WORKING_DIRECTORY ${DOWNLOADS} | ||
LOGNAME clone | ||
) | ||
endif() | ||
message(STATUS "Cloning done") | ||
|
||
if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") | ||
message(STATUS "Adding worktree") | ||
vcpkg_execute_required_process( | ||
COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REV} | ||
WORKING_DIRECTORY ${DOWNLOADS}/grpc.git | ||
LOGNAME worktree | ||
) | ||
message(STATUS "Updating sumbodules") | ||
vcpkg_execute_required_process( | ||
COMMAND ${GIT} submodule update --init third_party/nanopb | ||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src | ||
LOGNAME submodule | ||
) | ||
endif() | ||
message(STATUS "Adding worktree and updating sumbodules done") | ||
|
||
vcpkg_configure_cmake( | ||
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src | ||
OPTIONS | ||
-DgRPC_INSTALL=ON | ||
-DgRPC_ZLIB_PROVIDER=package | ||
-DgRPC_SSL_PROVIDER=package | ||
-DgRPC_PROTOBUF_PROVIDER=package | ||
) | ||
|
||
vcpkg_build_cmake() | ||
vcpkg_install_cmake() | ||
|
||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/grpc) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCConfig.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCConfig.cmake) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCConfigVersion.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCConfigVersion.cmake) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets.cmake) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets-release.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-release.cmake) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/gRPC/gRPCTargets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-debug.cmake) | ||
|
||
file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright) | ||
|
||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) | ||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) | ||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) | ||
|
||
vcpkg_copy_pdbs() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Source: protobuf | ||
Version: 3.0.2 | ||
Build-Depends: zlib | ||
Description: Protocol Buffers - Google's data interchange format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
include(vcpkg_common_functions) | ||
vcpkg_download_distfile(ARCHIVE_FILE | ||
URLS "https://github.com/google/protobuf/releases/download/v3.0.2/protobuf-cpp-3.0.2.tar.gz" | ||
FILENAME "protobuf-cpp-3.0.2.tar.gz" | ||
SHA512 5c99fa5d20815f9333a1e30d4da7621375e179abab6e4369ef0827b6ea6a679afbfec445dda21a72b4ab11e1bdd72c0f17a4e86b153ea8e2d3298dc3bcfcd643 | ||
) | ||
vcpkg_download_distfile(TOOL_ARCHIVE_FILE | ||
URLS "https://github.com/google/protobuf/releases/download/v3.0.2/protoc-3.0.2-win32.zip" | ||
FILENAME "protoc-3.0.2-win32.zip" | ||
SHA512 51c67bd8bdc35810da70786d873935814679c58b74e653923671bdf06b8b69a1c9a0793d090b17d25e91ddafff1726bcfcdd243373dd47c4aeb9ea83fbabaeb0 | ||
) | ||
vcpkg_extract_source_archive(${ARCHIVE_FILE}) | ||
vcpkg_extract_source_archive(${TOOL_ARCHIVE_FILE} ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2-win32) | ||
|
||
vcpkg_configure_cmake( | ||
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2/cmake | ||
OPTIONS | ||
-Dprotobuf_BUILD_SHARED_LIBS=OFF | ||
-Dprotobuf_MSVC_STATIC_RUNTIME=OFF | ||
-Dprotobuf_WITH_ZLIB=ON | ||
-Dprotobuf_BUILD_TESTS=OFF | ||
-DCMAKE_INSTALL_CMAKEDIR=share/protobuf | ||
) | ||
|
||
vcpkg_install_cmake() | ||
|
||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) | ||
|
||
file(READ ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake RELEASE_MODULE) | ||
string(REPLACE "\${_IMPORT_PREFIX}/bin/protoc.exe" "\${_IMPORT_PREFIX}/tools/protoc.exe" RELEASE_MODULE "${RELEASE_MODULE}") | ||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake "${RELEASE_MODULE}") | ||
|
||
file(READ ${CURRENT_PACKAGES_DIR}/debug/share/protobuf/protobuf-targets-debug.cmake DEBUG_MODULE) | ||
string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${DEBUG_MODULE}") | ||
string(REPLACE "\${_IMPORT_PREFIX}/debug/bin/protoc.exe" "\${_IMPORT_PREFIX}/tools/protoc.exe" DEBUG_MODULE "${DEBUG_MODULE}") | ||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake "${DEBUG_MODULE}") | ||
|
||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) | ||
|
||
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/protoc.exe) | ||
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/protoc.exe) | ||
|
||
file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright) | ||
file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2-win32/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) | ||
vcpkg_copy_pdbs() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for forcing ZLIB on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, we don't have a good story for optional dependencies (we're working on it!). Since zlib is so ubiquitous, it's cheap to require and provides more functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because ZLIB disabled only for MSVC
I think this is only because protobuf authors don't have zlib on Windows, but we have now zlib in vcpkg.