From 0e89b03be63c8b0a4ffb530cc20dc29aa01844db Mon Sep 17 00:00:00 2001 From: David Seifert Date: Sat, 15 Sep 2018 13:13:53 +0200 Subject: [PATCH] Do not use relative RPATHs on macOS with ICC/GCC * Currently, absolute rpaths on macOS are only used with Clang, which breaks Meson builds when using ICC or GCC from Homebrew or MacPorts. --- mesonbuild/compilers/c.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index acd3b3da5..9b7ac6802 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -121,7 +121,8 @@ class CCompiler(Compiler): # The default behavior is this, override in MSVC @functools.lru_cache(maxsize=None) def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): - if self.id == 'clang' and self.compiler_type == CompilerType.CLANG_OSX: + if getattr(self, 'compiler_type', False) and self.compiler_type.is_osx_compiler: + # Clang, GCC and ICC on macOS all use the same rpath arguments return self.build_osx_rpath_args(build_dir, rpath_paths, build_rpath) return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, build_rpath, install_rpath)