From 4c992d9a66c0e11f36b682163e6a9cef4b1e5877 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sun, 4 Sep 2022 10:57:08 +0200
Subject: [PATCH 2/5] set static lib extension on windows

---
 CMakeLists.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac0d03c3a..a23b773fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -326,6 +326,12 @@ else ()
   endif ()
 endif ()
 
+if (MSVC AND NOT protobuf_BUILD_SHARED_LIBS)
+  set_target_properties(libprotoc PROPERTIES SUFFIX "-static.lib")
+  set_target_properties(libprotobuf PROPERTIES SUFFIX "-static.lib")
+  set_target_properties(libprotobuf-lite PROPERTIES SUFFIX "-static.lib")
+endif (MSVC AND NOT protobuf_BUILD_SHARED_LIBS)
+
 # Ensure we have a protoc executable and protobuf libraries if we need one
 if (protobuf_BUILD_TESTS OR protobuf_BUILD_CONFORMANCE OR protobuf_BUILD_EXAMPLES)
   if (NOT DEFINED protobuf_PROTOC_EXE)
