summaryrefslogtreecommitdiff
path: root/CMake/AbseilHelpers.cmake
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2024-09-03 11:49:29 -0400
committerGravatar Benjamin Barenblat <bbaren@google.com>2024-09-03 11:49:29 -0400
commitc1afa8b8238c25591ca80d068477aa7d4ce05fc8 (patch)
tree284a9f8b319de5783ff83ad004a9e390cb60fd0d /CMake/AbseilHelpers.cmake
parent23778b53f420f54eebc195dd8430e79bda165e5b (diff)
parent4447c7562e3bc702ade25105912dce503f0c4010 (diff)
Merge new upstream LTS 20240722.0
Diffstat (limited to 'CMake/AbseilHelpers.cmake')
-rw-r--r--CMake/AbseilHelpers.cmake19
1 files changed, 17 insertions, 2 deletions
diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
index c53b3584..b177e590 100644
--- a/CMake/AbseilHelpers.cmake
+++ b/CMake/AbseilHelpers.cmake
@@ -186,8 +186,16 @@ function(absl_cc_library)
endif()
endif()
endforeach()
+ set(skip_next_cflag OFF)
foreach(cflag ${ABSL_CC_LIB_COPTS})
- if(${cflag} MATCHES "^(-Wno|/wd)")
+ if(skip_next_cflag)
+ set(skip_next_cflag OFF)
+ elseif(${cflag} MATCHES "^-Xarch_")
+ # An -Xarch_ flag implies that its successor only applies to the
+ # specified platform. Filter both of them out before the successor
+ # reaches the "^-m" filter.
+ set(skip_next_cflag ON)
+ elseif(${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])")
@@ -250,6 +258,13 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
elseif(_build_type STREQUAL "static" OR _build_type STREQUAL "shared")
add_library(${_NAME} "")
target_sources(${_NAME} PRIVATE ${ABSL_CC_LIB_SRCS} ${ABSL_CC_LIB_HDRS})
+ if(APPLE)
+ set_target_properties(${_NAME} PROPERTIES
+ INSTALL_RPATH "@loader_path")
+ elseif(UNIX)
+ set_target_properties(${_NAME} PROPERTIES
+ INSTALL_RPATH "$ORIGIN")
+ endif()
target_link_libraries(${_NAME}
PUBLIC ${ABSL_CC_LIB_DEPS}
PRIVATE
@@ -298,7 +313,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
if(ABSL_ENABLE_INSTALL)
set_target_properties(${_NAME} PROPERTIES
OUTPUT_NAME "absl_${_NAME}"
- SOVERSION "2401.0.0"
+ SOVERSION "${ABSL_SOVERSION}"
)
endif()
else()