vcpkg/ports/grpc/00002-static-linking-in-linux.patch

17 lines
597 B
Diff
Raw Normal View History

diff --git a/CMakeLists.txt b/CMakeLists.txt
2020-08-23 13:25:20 +08:00
index 086d4c5837..e556a99b47 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
2020-08-23 13:25:20 +08:00
@@ -183,6 +183,11 @@ if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
2020-08-22 16:16:03 +08:00
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
2020-08-22 16:16:03 +08:00
+if (gRPC_STATIC_LINKING AND NOT _gRPC_PLATFORM_WINDOWS)
+ # Force to static link
+ set(CMAKE_EXE_LINKER_FLAGS "-Bstatic")
+endif()
2020-08-22 16:16:03 +08:00
+
if(MSVC)
include(cmake/msvc_static_runtime.cmake)
2020-08-22 16:16:03 +08:00
add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS)