chore(shared-libraries): add @executable_path/lib to @rpath for good measure

This commit is contained in:
2021-05-16 17:08:02 +01:00
parent 0a22d8393c
commit 3ffeb4854c

View File

@@ -628,6 +628,11 @@ class LibEmbedder < AbstractEmbedder
Pathname.new(File.dirname(exe))
).to_s
while_writable(exe) do
system('install_name_tool', '-add_rpath',
File.join('@executable_path', rel_path), exe)
end
`otool -L "#{exe}"`.split("\n")[1..-1].each do |line|
match = line.match(%r{^\s+(.+/(lib[^/ ]+))\s})
next unless match && match[1].start_with?(lib_source)