vcpkg/ports/grpc/00002-static-linking-in-linux.patch
Jack·Boos·Yu c75f0b32a6
[grpc] Update to 1.29.1 (#11791)
* [grpc] Update to 1.29.1

* re-fix uwp build

* re-fix dependency upb

* [offscale-libetcd-cpp] Fix dependency grpc
2020-06-23 14:36:26 -07:00

17 lines
482 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 84de29f..0c6dc0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -165,6 +165,11 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
+
+if (gRPC_STATIC_LINKING AND NOT _gRPC_PLATFORM_WINDOWS)
+ # Force to static link
+ set(CMAKE_EXE_LINKER_FLAGS "-Bstatic")
+endif()
if(MSVC)
include(cmake/msvc_static_runtime.cmake)