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

17 lines
482 B
Diff
Raw Normal View History

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)