diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-08-22 22:40:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-22 22:40:44 +0300 |
commit | a9f33d96c674763657315770a99358d271206551 (patch) | |
tree | de831b9144d7fbb0478221dba3f858fcf6a9470d /mesonbuild/environment.py | |
parent | e9a71ebf60a91443ae024dea94a8b68d46987589 (diff) | |
parent | 2845f5a2302de86e04efe7d9a153e05bde3caa65 (diff) | |
download | meson-a9f33d96c674763657315770a99358d271206551.zip meson-a9f33d96c674763657315770a99358d271206551.tar.gz meson-a9f33d96c674763657315770a99358d271206551.tar.bz2 |
Merge pull request #7609 from dcbaker/submit/2020-08/cmake-fix-apple-clang
Fix mapping of apple compilers in cmake
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 18ecff4..492789c 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -76,6 +76,8 @@ from .compilers import ( ArmclangCPPCompiler, AppleClangCCompiler, AppleClangCPPCompiler, + AppleClangObjCCompiler, + AppleClangObjCPPCompiler, ClangCCompiler, ClangCPPCompiler, ClangObjCCompiler, @@ -1527,7 +1529,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) @@ -1556,7 +1558,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: |