vcpkg/ports/grpc/00002-static-linking-in-linux.patch
Carlos O'Ryan ebe505081b [grpc] Upgrade to gRPC-1.26.0 (#9363)
* WIP - Upgrade gRPC to 1.26.0

* Updated patch 00001

* Update 00002 patch.

* Update 00003

* Update 00005

* Remove 00007 patch.

* Really fix patch 00005

* Use CRLF for patches as before 🤷
2020-01-06 12:24:51 -08:00

17 lines
526 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2f23d5..e433e8d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,6 +111,11 @@ endif()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+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)