aboutsummaryrefslogtreecommitdiff
path: root/ports/grpc
diff options
context:
space:
mode:
authorras0219 <533828+ras0219@users.noreply.github.com>2021-03-26 12:55:34 -0700
committerGitHub <noreply@github.com>2021-03-26 12:55:34 -0700
commitb5bb1511f0a07be530e0bde3ae098eb3d8e83e68 (patch)
tree62f7ed43202e512d28ac92fb2be768283f62dee9 /ports/grpc
parent6a63ecae92e3eb26ae596e5c4ddf527f045803a4 (diff)
downloadvcpkg-b5bb1511f0a07be530e0bde3ae098eb3d8e83e68.tar.gz
vcpkg-b5bb1511f0a07be530e0bde3ae098eb3d8e83e68.zip
[many ports] Apply host dependencies (#16479)
* [vcpkg] Add VCPKG_HOST_TRIPLET. Improve vcpkg.schema.json * [many ports] Apply host dependencies * [yasm-tool] Revert yasm-tool changes to split into PR #16478 * [many ports] Add versions * [vcpkg.cmake] Revert change applied in other PR * [boost-modular-build-helper] Merge from master Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'ports/grpc')
-rw-r--r--ports/grpc/gRPCTargets-vcpkg-tools.cmake10
-rw-r--r--ports/grpc/portfile.cmake15
-rw-r--r--ports/grpc/vcpkg.json10
3 files changed, 29 insertions, 6 deletions
diff --git a/ports/grpc/gRPCTargets-vcpkg-tools.cmake b/ports/grpc/gRPCTargets-vcpkg-tools.cmake
new file mode 100644
index 000000000..08e3ee3af
--- /dev/null
+++ b/ports/grpc/gRPCTargets-vcpkg-tools.cmake
@@ -0,0 +1,10 @@
+file(GLOB GRPC_PLUGINS "${_IMPORT_PREFIX}/../@HOST_TRIPLET@/tools/grpc/grpc_*_plugin*")
+
+foreach(PLUGIN ${GRPC_PLUGINS})
+ get_filename_component(PLUGIN_NAME "${PLUGIN}" NAME_WE)
+ add_executable(gRPC::${PLUGIN_NAME} IMPORTED)
+ set_property(TARGET gRPC::${PLUGIN_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(gRPC::${PLUGIN_NAME} PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${PLUGIN}"
+ )
+endforeach()
diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake
index 648b41b61..8102f4492 100644
--- a/ports/grpc/portfile.cmake
+++ b/ports/grpc/portfile.cmake
@@ -21,10 +21,11 @@ vcpkg_from_github(
00012-fix-use-cxx17.patch
)
-if((NOT VCPKG_TARGET_IS_LINUX AND NOT VCPKG_TARGET_IS_OSX) AND (VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64"))
- set(gRPC_BUILD_CODEGEN OFF)
-else()
+if(TARGET_TRIPLET STREQUAL HOST_TRIPLET)
set(gRPC_BUILD_CODEGEN ON)
+else()
+ set(gRPC_BUILD_CODEGEN OFF)
+ vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/grpc")
endif()
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" gRPC_MSVC_STATIC_RUNTIME)
@@ -62,13 +63,15 @@ vcpkg_configure_cmake(
-DgRPC_INSTALL_BINDIR:STRING=bin
-DgRPC_INSTALL_LIBDIR:STRING=lib
-DgRPC_INSTALL_INCLUDEDIR:STRING=include
- -DgRPC_INSTALL_CMAKEDIR:STRING=share/gRPC
+ -DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc
-DgRPC_BUILD_CODEGEN=${gRPC_BUILD_CODEGEN}
+ -D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}
+ -DPROTOBUF_PROTOC_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}
)
vcpkg_install_cmake(ADD_BIN_TO_PATH)
-vcpkg_fixup_cmake_targets(CONFIG_PATH share/gRPC TARGET_PATH share/gRPC)
+vcpkg_fixup_cmake_targets()
if (gRPC_BUILD_CODEGEN)
vcpkg_copy_tools(
@@ -82,6 +85,8 @@ if (gRPC_BUILD_CODEGEN)
grpc_cpp_plugin
grpc_ruby_plugin
)
+else()
+ configure_file(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets-vcpkg-tools.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-vcpkg-tools.cmake @ONLY)
endif()
# Ignore the C# extension DLL in bin/
diff --git a/ports/grpc/vcpkg.json b/ports/grpc/vcpkg.json
index 0a180bea0..a639cdccb 100644
--- a/ports/grpc/vcpkg.json
+++ b/ports/grpc/vcpkg.json
@@ -1,7 +1,7 @@
{
"name": "grpc",
"version-string": "1.33.1",
- "port-version": 2,
+ "port-version": 3,
"description": "An RPC library and framework",
"homepage": "https://github.com/grpc/grpc",
"dependencies": [
@@ -10,8 +10,16 @@
"name": "c-ares",
"platform": "!uwp"
},
+ {
+ "name": "grpc",
+ "host": true
+ },
"openssl",
"protobuf",
+ {
+ "name": "protobuf",
+ "host": true
+ },
"re2",
"upb",
"zlib"