File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,17 @@ function(swift_get_set_rpath_script_file out_var)
4
4
set (${out_var} "${SWIFT_SET_RPATH_SCRIPT_FILE} " PARENT_SCOPE )
5
5
endfunction ()
6
6
7
- # Actual RPATH_SET operation to the file.
7
+ # Actual RPATH_CHANGE operation to the file.
8
8
function (_swift_set_rpath_impl file new_rpath )
9
- # NOTE: RPATH_SET is not documented, and works only for ELF and XCOFF.
10
- file (RPATH_SET FILE "${file} " NEW_RPATH "${new_rpath} " )
9
+ execute_process (
10
+ COMMAND readelf -Wd "${file} "
11
+ COMMAND grep -Po "R(UN)?PATH.*\\ [\\ K[^\\ ]]*"
12
+ OUTPUT_VARIABLE current_rpath
13
+ )
14
+ string (STRIP "${current_rpath} " current_rpath )
15
+
16
+ # NOTE: RPATH_CHANGE is not documented, and works only for ELF and XCOFF.
17
+ file (RPATH_CHANGE FILE "${file} " OLD_RPATH "${current_rpath} " NEW_RPATH "${new_rpath} " )
11
18
endfunction ()
12
19
13
20
# For 'cmake -P <scirpt>'.
You can’t perform that action at this time.
0 commit comments