Browse Source

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++
tags/0.56.0.rc1
Dylan Baker 1 month ago
parent
commit
dff40ca259
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      mesonbuild/environment.py

+ 5
- 1
mesonbuild/environment.py View File

@@ -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):


Loading…
Cancel
Save