/
protobuf-v3.21.4.patch
26 lines (26 loc) · 1.26 KB
/
protobuf-v3.21.4.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 04cb3303..2e93b19c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -219,7 +219,7 @@ else (protobuf_BUILD_SHARED_LIBS)
if (protobuf_MSVC_STATIC_RUNTIME)
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>)
else()
- set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>DLL)
+ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<NOT:$<STREQUAL:${VCPKG_CRT_LINKAGE},static>>:DLL>")
endif()
else()
# In case we are building static libraries, link also the runtime library statically
diff --git a/src/google/protobuf/metadata_lite.h b/src/google/protobuf/metadata_lite.h
index 0c31517f..58e86b9b 100644
--- a/src/google/protobuf/metadata_lite.h
+++ b/src/google/protobuf/metadata_lite.h
@@ -78,7 +78,7 @@ class PROTOBUF_EXPORT InternalMetadata {
// the destructor is always defined here even though it may delegate
// to a non-inline private method.
// (see https://github.com/protocolbuffers/protobuf/issues/9947)
- ~InternalMetadata() {
+ PROTOBUF_NOINLINE ~InternalMetadata() {
#if defined(NDEBUG) || defined(_MSC_VER)
if (HasMessageOwnedArenaTag()) {
delete reinterpret_cast<Arena*>(ptr_ - kMessageOwnedArenaTagMask);