From 6137fefd543de0aca634ef820f83f7e9d6e6f075 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/9] set static lib extension on windows

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 162fb1c72..1f175c416 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)
