Skip to content

Commit

Permalink
PR #1726: cmake: Fix RUNPATH when using BUILD_WITH_INSTALL_RPATH=True
Browse files Browse the repository at this point in the history
Imported from GitHub PR #1726

ref: https://cmake.org/cmake/help/latest/prop_tgt/BUILD_WITH_INSTALL_RPATH.html
Merge d7d4607 into 5ea745c

Merging this change closes #1726

COPYBARA_INTEGRATE_REVIEW=#1726 from Mizux:master d7d4607
PiperOrigin-RevId: 655593538
Change-Id: Iedd70d3a8b4f6256664aee26a698d4af0523d6b8
  • Loading branch information
Mizux authored and copybara-github committed Jul 24, 2024
1 parent 5ea745c commit 2138590
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMake/AbseilHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -258,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
Expand Down

0 comments on commit 2138590

Please sign in to comment.