From 29f351c05a828dbc943ae2a80899e05f8aed2d2f Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 19 Jul 2019 09:07:23 -0700 Subject: environment: Handle OBJC[PP] clang detection like C[PP] Which fixes using a non Apple clang for objc and objc++ on macOS. --- mesonbuild/environment.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'mesonbuild') 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): -- cgit v1.1