aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-12-03 02:25:44 +0200
committerGitHub <noreply@github.com>2017-12-03 02:25:44 +0200
commit554b484468c74621168f7bb7faf7110e7e72ebd5 (patch)
treee754d208928cb574b0dd5b6d3637e946d6d413df /mesonbuild/compilers/compilers.py
parente4f5fe1b356c0950ff51fd4f20da74b9cd03141b (diff)
parentab1f49f4002116b1bf2fa3642a3bd6bd19a89b27 (diff)
downloadmeson-554b484468c74621168f7bb7faf7110e7e72ebd5.zip
meson-554b484468c74621168f7bb7faf7110e7e72ebd5.tar.gz
meson-554b484468c74621168f7bb7faf7110e7e72ebd5.tar.bz2
Merge pull request #2618 from mesonbuild/osxlinkerfixes
Fix many things have have been slightly broken in OSX
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 7087b3e..011c222 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -817,6 +817,16 @@ class Compiler:
def get_instruction_set_args(self, instruction_set):
return None
+ def build_osx_rpath_args(self, build_dir, rpath_paths, build_rpath):
+ if not rpath_paths and not build_rpath:
+ return []
+ # On OSX, rpaths must be absolute.
+ abs_rpaths = [os.path.join(build_dir, p) for p in rpath_paths]
+ if build_rpath != '':
+ abs_rpaths.append(build_rpath)
+ args = ['-Wl,-rpath,' + rp for rp in abs_rpaths]
+ return args
+
def build_unix_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
if not rpath_paths and not install_rpath and not build_rpath:
return []
@@ -879,7 +889,11 @@ def get_gcc_soname_args(gcc_type, prefix, shlib_name, suffix, path, soversion, i
elif gcc_type == GCC_OSX:
if is_shared_module:
return []
- return ['-install_name', os.path.join(path, 'lib' + shlib_name + '.dylib')]
+ install_name = prefix + shlib_name
+ if soversion is not None:
+ install_name += '.' + soversion
+ install_name += '.dylib'
+ return ['-install_name', os.path.join('@rpath', install_name)]
else:
raise RuntimeError('Not implemented yet.')