vcpkg/ports/grpc/00002-static-linking-in-linux.patch
ymshenyu acdbfaec17
[gRPC] Update to 1.27.1 (#9963)
* gRPC 1.27.0

* trigger build

* update to v1.27.1

* update control file
2020-02-11 16:33:48 -08:00

17 lines
576 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25d96ab..c4057b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,6 +152,11 @@ endif()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(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)
add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS)