diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-08-17 22:23:34 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-08-22 10:49:35 -0700 |
commit | b6c28d282c99a0a7915f9924d98d620f70403814 (patch) | |
tree | ec2e44a13f71668c9245d060e3cf308112dfd8a0 /mesonbuild/environment.py | |
parent | 7092efabb5a0488b694418c823463048ddbb310c (diff) | |
download | meson-b6c28d282c99a0a7915f9924d98d620f70403814.zip meson-b6c28d282c99a0a7915f9924d98d620f70403814.tar.gz meson-b6c28d282c99a0a7915f9924d98d620f70403814.tar.bz2 |
compilers: Add Apple subclasses for ObjC and ObjC++
These are needed because in some cases we need to be able to know if
we're using vanilla clang or Apple's clang.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index da2d513..5645c71 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -74,6 +74,8 @@ from .compilers import ( ArmclangCPPCompiler, AppleClangCCompiler, AppleClangCPPCompiler, + AppleClangObjCCompiler, + AppleClangObjCPPCompiler, ClangCCompiler, ClangCPPCompiler, ClangObjCCompiler, @@ -1506,7 +1508,7 @@ class Environment: def detect_objcpp_compiler(self, for_machine: MachineInfo) -> 'Compiler': return self._detect_objc_or_objcpp_compiler(for_machine, False) - def _detect_objc_or_objcpp_compiler(self, for_machine: MachineInfo, objc: bool) -> 'Compiler': + def _detect_objc_or_objcpp_compiler(self, for_machine: MachineChoice, objc: bool) -> 'Compiler': popen_exceptions = {} compilers, ccache, exe_wrap = self._get_compilers('objc' if objc else 'objcpp', for_machine) is_cross = self.is_cross_build(for_machine) @@ -1535,7 +1537,10 @@ class Environment: exe_wrap, defines, linker=linker) if 'clang' in out: linker = None - comp = ClangObjCCompiler if objc else ClangObjCPPCompiler + if 'Apple' in out: + comp = AppleClangObjCCompiler if objc else AppleClangObjCPPCompiler + else: + comp = ClangObjCCompiler if objc else ClangObjCPPCompiler if 'windows' in out or self.machines[for_machine].is_windows(): # If we're in a MINGW context this actually will use a gnu style ld try: |