diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-09-21 13:05:39 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-09-24 12:14:13 -0700 |
commit | dff40ca259c396568eeb4d05c534781ca148f8e7 (patch) | |
tree | 953aa8c688e5683c896371cc7d5eb406c7f39282 /mesonbuild/environment.py | |
parent | da4c1945fc2ea969adec8e3e2ada3082ca5810f8 (diff) | |
download | meson-dff40ca259c396568eeb4d05c534781ca148f8e7.zip meson-dff40ca259c396568eeb4d05c534781ca148f8e7.tar.gz meson-dff40ca259c396568eeb4d05c534781ca148f8e7.tar.bz2 |
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++
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 5a4b2ac..513a03c 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): |