summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2022-05-24 07:23:56 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-05-24 07:25:42 -0700
commit1963f10ae5cb32a7ea6d96b928f69d3c7fba0139 (patch)
tree73c3b5a2fef7784a5be589f709dde527e645a0d5 /CMake
parent2d492a13c652df2d3fa9b4712cb4ac91f120478c (diff)
Don’t use generator expression to build .pc Libs lines
When building pkg-config files, compute linker flags with a string substitution rather than the JOIN generator expression. This ensures that commas in linker flags don’t get treated as argument separators in JOIN. Bug: https://bugs.debian.org/1011294 PiperOrigin-RevId: 450675966 Change-Id: I61eacc46a468bae5ff3dae2b437a564f2f1042c2
Diffstat (limited to 'CMake')
-rw-r--r--CMake/AbseilHelpers.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
index ed87dde0..6d03381b 100644
--- a/CMake/AbseilHelpers.cmake
+++ b/CMake/AbseilHelpers.cmake
@@ -170,6 +170,7 @@ function(absl_cc_library)
set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
endif()
endforeach()
+ string(REPLACE ";" " " PC_LINKOPTS "${ABSL_CC_LIB_LINKOPTS}")
FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/lib/pkgconfig/absl_${_NAME}.pc" CONTENT "\
prefix=${CMAKE_INSTALL_PREFIX}\n\
exec_prefix=\${prefix}\n\
@@ -181,7 +182,7 @@ Description: Abseil ${_NAME} library\n\
URL: https://abseil.io/\n\
Version: ${PC_VERSION}\n\
Requires:${PC_DEPS}\n\
-Libs: -L\${libdir} $<JOIN:${ABSL_CC_LIB_LINKOPTS}, > $<$<NOT:$<BOOL:${ABSL_CC_LIB_IS_INTERFACE}>>:-labsl_${_NAME}>\n\
+Libs: -L\${libdir} ${PC_LINKOPTS} $<$<NOT:$<BOOL:${ABSL_CC_LIB_IS_INTERFACE}>>:-labsl_${_NAME}>\n\
Cflags: -I\${includedir}${PC_CFLAGS}\n")
INSTALL(FILES "${CMAKE_BINARY_DIR}/lib/pkgconfig/absl_${_NAME}.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")