Skip to content

Commit

Permalink
PkgConfig: account for possible debug postfix in library name (#19444)
Browse files Browse the repository at this point in the history
PkgConfig: account for possible debug postfix in library name, this fixes #19325

Closes #19444

COPYBARA_INTEGRATE_REVIEW=#19444 from andresailer:pkgConfigD 8f353cb
PiperOrigin-RevId: 702547617
  • Loading branch information
andresailer authored and copybara-github committed Dec 4, 2024
1 parent bedda1d commit 3b38918
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ if (protobuf_BUILD_SHARED_LIBS)
set(_protobuf_PC_CFLAGS -DPROTOBUF_USE_DLLS)
endif ()

if(CMAKE_BUILD_TYPE STREQUAL Debug)
# attach debug postfix only in debug mode
set(protobuf_LIBRARY_POSTFIX ${protobuf_DEBUG_POSTFIX})
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/protobuf.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/protobuf-lite.pc.cmake
Expand Down
2 changes: 1 addition & 1 deletion cmake/protobuf.pc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: @protobuf_VERSION@
Requires: @_protobuf_PC_REQUIRES@
Libs: -L${libdir} -lprotobuf @CMAKE_THREAD_LIBS_INIT@
Libs: -L${libdir} -lprotobuf@protobuf_LIBRARY_POSTFIX@ @CMAKE_THREAD_LIBS_INIT@
Cflags: -I${includedir} @_protobuf_PC_CFLAGS@
Conflicts: protobuf-lite

0 comments on commit 3b38918

Please sign in to comment.