diff --git a/packages/grpc-tools/CMakeLists.txt b/packages/grpc-tools/CMakeLists.txt index 4cb9e14ae..e13d9a28d 100644 --- a/packages/grpc-tools/CMakeLists.txt +++ b/packages/grpc-tools/CMakeLists.txt @@ -22,8 +22,8 @@ SET(PROTOBUF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps/protobuf) ADD_SUBDIRECTORY(${PROTOBUF_ROOT_DIR}/cmake deps/protobuf) -SET(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++ -static -Wl,-Bstatic") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-stack-protector -static -Wl,-Bstatic") +SET(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-stack-protector") ADD_EXECUTABLE(grpc_node_plugin src/node_generator.cc diff --git a/packages/grpc-tools/linux.toolchain.cmake b/packages/grpc-tools/linux.toolchain.cmake index 974dc84a8..30cf63ac1 100644 --- a/packages/grpc-tools/linux.toolchain.cmake +++ b/packages/grpc-tools/linux.toolchain.cmake @@ -1,6 +1,10 @@ IF(UNIX AND NOT APPLE) SET(CMAKE_COMPILER_PREFIX "") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -Wl,-Bstatic") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -Wl,-Bstatic") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -Wl,-Bstatic") + IF(GRPC_TOOLS_TARGET STREQUAL "x86_64") SET(CMAKE_COMPILER_PREFIX "x86_64-linux-gnu-")