diff --git a/extra/protobuf/CMakeLists.txt b/extra/protobuf/CMakeLists.txt index 3b2d047528c..e4a7e332488 100644 --- a/extra/protobuf/CMakeLists.txt +++ b/extra/protobuf/CMakeLists.txt @@ -87,7 +87,11 @@ SET(protobuf_BUILD_EXAMPLES OFF CACHE INTERNAL "") IF(SOLARIS) SET(protobuf_BUILD_SHARED_LIBS OFF CACHE INTERNAL "") ELSE() - SET(protobuf_BUILD_SHARED_LIBS ON CACHE INTERNAL "") + IF(CMAKE_CXX_FLAGS MATCHES "-static-libgcc") + SET(protobuf_BUILD_SHARED_LIBS OFF CACHE INTERNAL "") + ELSE() + SET(protobuf_BUILD_SHARED_LIBS ON CACHE INTERNAL "") + ENDIF() ENDIF() SET(protobuf_MSVC_STATIC_RUNTIME OFF CACHE INTERNAL "")