From c0759889e6f5a9899532e54bde8232564a1ff8dc Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Tue, 20 Feb 2024 20:27:36 +1100
Subject: [PATCH 8/9] fix pkg-config metadata for shared abseil on windows

---
 cmake/install.cmake | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cmake/install.cmake b/cmake/install.cmake
index f68ec217b..60871aab9 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -1,7 +1,10 @@
 include(GNUInstallDirs)
 
 foreach(_target IN LISTS protobuf_ABSL_USED_TARGETS)
-  string(REPLACE :: _ _modified_target ${_target})
+  # shared abseil on windows breaks the absl::foo -> absl_foo replacement logic -
+  # preempt this by a more specific replace (harmless if it doesn't apply); see GH-15883
+  string(REPLACE "absl::abseil_dll" "abseil_dll" _modified_target ${_target})
+  string(REPLACE :: _ _modified_target ${_modified_target})
   list(APPEND _pc_targets ${_modified_target})
 endforeach()
 list(APPEND _pc_targets "utf8_range")
