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.
@@ -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)
