diff options
Diffstat (limited to 'ports/grpc/fix-uwp.patch')
| -rw-r--r-- | ports/grpc/fix-uwp.patch | 129 |
1 files changed, 57 insertions, 72 deletions
diff --git a/ports/grpc/fix-uwp.patch b/ports/grpc/fix-uwp.patch index 85ee80eec..a3fb3ef89 100644 --- a/ports/grpc/fix-uwp.patch +++ b/ports/grpc/fix-uwp.patch @@ -1,18 +1,18 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 51f6e17..d33b147 100644
+index f58ee19..dda72e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -84,6 +84,9 @@ if(UNIX)
+@@ -87,6 +87,9 @@ if(UNIX)
endif()
if(WIN32)
set(_gRPC_PLATFORM_WINDOWS ON)
-+ if(${CMAKE_SYSTEM_NAME} MATCHES "WindowsStore")
++ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(_gRPC_PLATFORM_UWP ON)
+ endif()
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
-@@ -144,6 +147,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR})
+@@ -152,6 +155,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR})
# ``.proto`` files
#
function(protobuf_generate_grpc_cpp)
@@ -23,7 +23,7 @@ index 51f6e17..d33b147 100644 if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files")
return()
-@@ -178,6 +185,7 @@ function(protobuf_generate_grpc_cpp)
+@@ -186,6 +193,7 @@ function(protobuf_generate_grpc_cpp)
endforeach()
endfunction()
@@ -31,94 +31,79 @@ index 51f6e17..d33b147 100644 add_custom_target(plugins
DEPENDS
grpc_cpp_plugin
-@@ -199,6 +207,7 @@ add_custom_target(tools_c
- gen_legal_metadata_characters
- gen_percent_encoding_tables
- )
-+endif()
-
- add_custom_target(tools_cxx
- DEPENDS
-@@ -3223,7 +3232,7 @@ if (gRPC_INSTALL)
- )
- endif()
+@@ -215,6 +223,8 @@ add_custom_target(tools_cxx
+ add_custom_target(tools
+ DEPENDS tools_c tools_cxx)
--
-+if(NOT _gRPC_PLATFORM_UWP)
- add_library(grpc++_error_details
- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.pb.cc
- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.grpc.pb.cc
-@@ -3285,6 +3294,7 @@ if (gRPC_INSTALL)
- ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
- )
- endif()
+endif()
-
++
if (gRPC_BUILD_TESTS)
+ add_custom_target(buildtests_c)
+ add_dependencies(buildtests_c algorithm_test)
+@@ -3595,7 +3605,6 @@ foreach(_hdr
+ DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
+ )
+ endforeach()
+-endif (gRPC_BUILD_CODEGEN)
-@@ -3347,6 +3357,7 @@ endforeach()
-
- endif (gRPC_BUILD_TESTS)
-+if(NOT _gRPC_PLATFORM_UWP)
- add_library(grpc++_reflection
- src/cpp/ext/proto_server_reflection.cc
- src/cpp/ext/proto_server_reflection_plugin.cc
-@@ -3409,6 +3420,7 @@ if (gRPC_INSTALL)
+ if (gRPC_INSTALL)
+@@ -3605,6 +3614,7 @@ if (gRPC_INSTALL)
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()
-+endif()
++endif (gRPC_BUILD_CODEGEN)
if (gRPC_BUILD_TESTS)
-@@ -4197,6 +4209,7 @@ endforeach()
-
- endif (gRPC_BUILD_TESTS)
-
-+if(NOT _gRPC_PLATFORM_UWP)
- add_library(grpc_plugin_support
- src/compiler/cpp_generator.cc
- src/compiler/csharp_generator.cc
-@@ -4236,6 +4249,8 @@ target_link_libraries(grpc_plugin_support
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- )
-+endif()
-+
-
- foreach(_hdr
- include/grpc++/impl/codegen/config_protobuf.h
-@@ -4248,7 +4263,7 @@ foreach(_hdr
+@@ -3725,7 +3735,7 @@ foreach(_hdr
+ DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
)
endforeach()
+-endif (gRPC_BUILD_CODEGEN)
++
+
--
-+if(NOT _gRPC_PLATFORM_UWP)
if (gRPC_INSTALL)
- install(TARGETS grpc_plugin_support EXPORT gRPCTargets
- RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
-@@ -4256,6 +4271,7 @@ if (gRPC_INSTALL)
+@@ -3735,6 +3745,7 @@ if (gRPC_INSTALL)
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()
-+endif()
++endif (gRPC_BUILD_CODEGEN)
if (gRPC_BUILD_TESTS)
-@@ -10252,6 +10268,7 @@ target_link_libraries(grpc_cli
+diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
+index 55efe0e..f538f26 100644
+--- a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
++++ b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
+@@ -60,6 +60,8 @@ bool check_bios_data(const char* bios_data_file) {
- endif (gRPC_BUILD_TESTS)
+ static void init_mu(void) { gpr_mu_init(&g_mu); }
-+if(NOT _gRPC_PLATFORM_UWP)
- add_executable(grpc_cpp_plugin
- src/compiler/cpp_plugin.cc
- )
-@@ -10488,6 +10505,7 @@ if (gRPC_INSTALL)
- ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
- )
- endif()
-+endif()
-
- if (gRPC_BUILD_TESTS)
++#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
++
+ static bool run_powershell() {
+ SECURITY_ATTRIBUTES sa;
+ sa.nLength = sizeof(sa);
+@@ -97,8 +99,12 @@ static bool run_powershell() {
+ CloseHandle(h);
+ return true;
+ }
++#endif
+
+ bool grpc_alts_is_running_on_gcp() {
++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
++ g_is_on_compute_engine = false;
++#else
+ gpr_once_init(&g_once, init_mu);
+ gpr_mu_lock(&g_mu);
+ if (!g_compute_engine_detection_done) {
+@@ -108,6 +114,7 @@ bool grpc_alts_is_running_on_gcp() {
+ g_compute_engine_detection_done = true;
+ }
+ gpr_mu_unlock(&g_mu);
++#endif
+ return g_is_on_compute_engine;
+ }
|
