vs_runtime.patch 847 B

1234567891011121314151617
  1. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
  2. index 51e8478f6..ebdc85bed 100644
  3. --- a/cmake/CMakeLists.txt
  4. +++ b/cmake/CMakeLists.txt
  5. @@ -182,7 +182,11 @@ else (protobuf_BUILD_SHARED_LIBS)
  6. # making programmatic control difficult. Prefer the functionality in newer
  7. # CMake versions when available.
  8. if(CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15)
  9. - set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>)
  10. + if (protobuf_MSVC_STATIC_RUNTIME)
  11. + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>)
  12. + else()
  13. + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>DLL)
  14. + endif()
  15. else()
  16. # In case we are building static libraries, link also the runtime library statically
  17. # so that MSVCR*.DLL is not required at runtime.