aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-07-19 09:07:23 -0700
committerDylan Baker <dylan@pnwbakers.com>2019-08-14 13:13:23 -0700
commit29f351c05a828dbc943ae2a80899e05f8aed2d2f (patch)
tree95365a844a98298d91c510b67c32bb9416fa1d8f
parente7db288e19ad262a48403524c6319a6b0266e06f (diff)
downloadmeson-29f351c05a828dbc943ae2a80899e05f8aed2d2f.zip
meson-29f351c05a828dbc943ae2a80899e05f8aed2d2f.tar.gz
meson-29f351c05a828dbc943ae2a80899e05f8aed2d2f.tar.bz2
environment: Handle OBJC[PP] clang detection like C[PP]
Which fixes using a non Apple clang for objc and objc++ on macOS.
-rw-r--r--mesonbuild/environment.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index b299677..6592e5e 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -956,14 +956,15 @@ class Environment:
version = self.get_gnu_version_from_defines(defines)
comp = GnuObjCCompiler if objc else GnuObjCPPCompiler
return comp(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, defines)
- else:
+ if 'clang' in out:
comp = ClangObjCCompiler if objc else ClangObjCPPCompiler
- if out.startswith('Apple LLVM') or out.startswith('Apple clang'):
- return comp(ccache + compiler, version, CompilerType.CLANG_OSX, for_machine, is_cross, exe_wrap)
- if 'windows' in out:
- return comp(ccache + compiler, version, CompilerType.CLANG_MINGW, for_machine, is_cross, exe_wrap)
- if out.startswith(('clang', 'OpenBSD clang')):
- return comp(ccache + compiler, version, CompilerType.CLANG_STANDARD, for_machine, is_cross, exe_wrap)
+ if 'Apple' in out or self.machines[for_machine].is_darwin():
+ compiler_type = CompilerType.CLANG_OSX
+ elif 'windows' in out or self.machines[for_machine].is_windows():
+ compiler_type = CompilerType.CLANG_MINGW
+ else:
+ compiler_type = CompilerType.CLANG_STANDARD
+ return comp(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap)
self._handle_exceptions(popen_exceptions, compilers)
def detect_java_compiler(self, for_machine):