Fix CMake error caused by relative RPATH.

PiperOrigin-RevId: 934847161
Change-Id: I7dce4161a8d8076d2d2c1c7b3234844733c5e8b0
This commit is contained in:
Michael Moss
2026-06-19 03:59:12 -07:00
committed by Copybara-Service
parent 976476c482
commit f663139256
+7 -2
View File
@@ -80,11 +80,13 @@ function(
_bin_dir
_lib_dir
)
get_filename_component(_bin_dir_abs "${_bin_dir}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
get_filename_component(_lib_dir_abs "${_lib_dir}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
file(
RELATIVE_PATH
_rel_path
${_bin_dir}
${_lib_dir}
${_bin_dir_abs}
${_lib_dir_abs}
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(${_output_var}
@@ -100,6 +102,9 @@ function(
endfunction()
function(target_add_rpath)
if(WIN32)
return()
endif()
set(_options USE_LINK_PATH)
set(_oneValueArgs INSTALL_NAME_DIR INSTALL_DIRECTORY)
set(_multiValueArgs TARGETS LIB_DIRS DEPENDS)