From dff40ca259c396568eeb4d05c534781ca148f8e7 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 21 Sep 2020 13:05:39 -0700 Subject: [PATCH] environment: Pass defines to clang based ObjC[++] compilers mypy noticed that we were passing [] (instead of a dict or None) to the ClangCompiler class in objc, which made me noticed that for C and C++ we set the defines, but not for ObjC and ObjC++ --- mesonbuild/environment.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 5a4b2ac95..513a03c46 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -1588,6 +1588,10 @@ class Environment: exe_wrap, defines, linker=linker) if 'clang' in out: linker = None + defines = self.get_clang_compiler_defines(compiler) + if not defines: + popen_exceptions[' '.join(compiler)] = 'no pre-processor defines' + continue if 'Apple' in out: comp = AppleClangObjCCompiler if objc else AppleClangObjCPPCompiler else: @@ -1604,7 +1608,7 @@ class Environment: compiler, comp, for_machine) return comp( ccache + compiler, version, for_machine, - is_cross, info, exe_wrap, linker=linker) + is_cross, info, exe_wrap, linker=linker, defines=defines) self._handle_exceptions(popen_exceptions, compilers) def detect_java_compiler(self, for_machine):