environment: Handle OBJC[PP] clang detection like C[PP]

Which fixes using a non Apple clang for objc and objc++ on macOS.
pull/5681/head
Dylan Baker 6 years ago
parent e7db288e19
commit 29f351c05a
  1. 15
      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):

Loading…
Cancel
Save