@@ -220,24 +220,6 @@ function _get_llvm_target_triple(self)
220
220
return llvm_targettriple or nil
221
221
end
222
222
223
- -- make the rpathdir flag
224
- function _rpathdir (self , dir )
225
- dir = path .translate (dir )
226
- if self :has_flags (" -Wl,-rpath=" .. dir , " ldflags" ) then
227
- local flags = {" -Wl,-rpath=" .. (dir :gsub (" @[%w_]+" , function (name )
228
- local maps = {[" @loader_path" ] = " $ORIGIN" , [" @executable_path" ] = " $ORIGIN" }
229
- return maps [name ]
230
- end ))}
231
- if self :is_plat (" bsd" ) then
232
- -- FreeBSD ld must have "-zorigin" with "-rpath". Otherwise, $ORIGIN is not translated and it is literal.
233
- table.insert (flags , 1 , " -Wl,-zorigin" )
234
- end
235
- return flags
236
- elseif self :has_flags (" -Xlinker -rpath -Xlinker " .. dir , " ldflags" ) then
237
- return {" -Xlinker" , " -rpath" , " -Xlinker" , (dir :gsub (" %$ORIGIN" , " @loader_path" ))}
238
- end
239
- end
240
-
241
223
-- make the runtime flag
242
224
-- @see https://github.com/xmake-io/xmake/issues/3546
243
225
function nf_runtime (self , runtime , opt )
@@ -309,9 +291,9 @@ function nf_runtime(self, runtime, opt)
309
291
maps [" c++_shared" ] = table .join (maps [" c++_shared" ], " -L" .. triple_libdir )
310
292
end
311
293
-- add rpath to avoid the user need to set LD_LIBRARY_PATH by hand
312
- maps [" c++_shared" ] = table .join (maps [" c++_shared" ], _rpathdir (self , libdir ))
294
+ maps [" c++_shared" ] = table .join (maps [" c++_shared" ], nf_rpathdir (self , libdir ))
313
295
if triple_libdir then
314
- maps [" c++_shared" ] = table .join (maps [" c++_shared" ], _rpathdir (self , triple_libdir ))
296
+ maps [" c++_shared" ] = table .join (maps [" c++_shared" ], nf_rpathdir (self , triple_libdir ))
315
297
end
316
298
if target :kind () == " shared" and self :is_plat (" macosx" , " iphoneos" , " watchos" ) then
317
299
maps [" c++_shared" ] = table .join (maps [" c++_shared" ], " -install_name" )
0 commit comments