diff options
author | Copybara-Service <copybara-worker@google.com> | 2022-12-14 07:29:02 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-12-14 07:29:02 -0800 |
commit | 3fe1e96ea9da8cf27589dfa988e4fe2eb220fccf (patch) | |
tree | 0a4afe150d4296c4656664db4abac4d4cea2f843 /CMake/AbseilDll.cmake | |
parent | a13ef44bf3f2ef5399c6fc587a18f3b203b4d37a (diff) | |
parent | 14abd930c61ef3ad2842f5c6b7ea60693b0d4ff9 (diff) | |
download | abseil-3fe1e96ea9da8cf27589dfa988e4fe2eb220fccf.tar.gz abseil-3fe1e96ea9da8cf27589dfa988e4fe2eb220fccf.tar.bz2 abseil-3fe1e96ea9da8cf27589dfa988e4fe2eb220fccf.zip |
Merge pull request #1341 from h-vetinari:pkgconfig
PiperOrigin-RevId: 495308617
Change-Id: Ic373a80908e513ce3cc4a9156d49aac8ebf89024
Diffstat (limited to 'CMake/AbseilDll.cmake')
-rw-r--r-- | CMake/AbseilDll.cmake | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake index 1d219dd2..0f884fbe 100644 --- a/CMake/AbseilDll.cmake +++ b/CMake/AbseilDll.cmake @@ -602,6 +602,33 @@ function(absl_make_dll) ${ABSL_DEFAULT_COPTS} ) + foreach(cflag ${ABSL_CC_LIB_COPTS}) + if(${cflag} MATCHES "^(-Wno|/wd)") + # These flags are needed to suppress warnings that might fire in our headers. + set(PC_CFLAGS "${PC_CFLAGS} ${cflag}") + elseif(${cflag} MATCHES "^(-W|/w[1234eo])") + # Don't impose our warnings on others. + else() + set(PC_CFLAGS "${PC_CFLAGS} ${cflag}") + endif() + endforeach() + string(REPLACE ";" " " PC_LINKOPTS "${ABSL_CC_LIB_LINKOPTS}") + + FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/lib/pkgconfig/abseil_dll.pc" CONTENT "\ +prefix=${CMAKE_INSTALL_PREFIX}\n\ +exec_prefix=\${prefix}\n\ +libdir=${CMAKE_INSTALL_FULL_LIBDIR}\n\ +includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}\n\ +\n\ +Name: abseil_dll\n\ +Description: Abseil DLL library\n\ +URL: https://abseil.io/\n\ +Version: ${absl_VERSION}\n\ +Libs: -L\${libdir} ${PC_LINKOPTS} $<$<NOT:$<BOOL:${ABSL_CC_LIB_IS_INTERFACE}>>:-labseil_dll>\n\ +Cflags: -I\${includedir}${PC_CFLAGS}\n") + INSTALL(FILES "${CMAKE_BINARY_DIR}/lib/pkgconfig/abseil_dll.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + target_compile_definitions( abseil_dll PRIVATE |