Add C compiler when using Cython

Since cython transpiles to C.
pull/8706/head
Dylan Baker 4 years ago
parent ec4d8143df
commit b9f33c2380
  1. 2
      mesonbuild/build.py
  2. 5
      mesonbuild/interpreter/interpreter.py

@ -812,7 +812,7 @@ class BuildTarget(Target):
# If all our sources are Vala, our target also needs the C compiler but # If all our sources are Vala, our target also needs the C compiler but
# it won't get added above. # it won't get added above.
if 'vala' in self.compilers and 'c' not in self.compilers: if ('vala' in self.compilers or 'cython' in self.compilers) and 'c' not in self.compilers:
self.compilers['c'] = compilers['c'] self.compilers['c'] = compilers['c']
def validate_sources(self): def validate_sources(self):

@ -1193,8 +1193,9 @@ external dependencies (including libraries) must go to "dependencies".''')
args = [a.lower() for a in args] args = [a.lower() for a in args]
langs = set(self.coredata.compilers[for_machine].keys()) langs = set(self.coredata.compilers[for_machine].keys())
langs.update(args) langs.update(args)
if 'vala' in langs and 'c' not in langs: if ('vala' in langs or 'cython' in langs) and 'c' not in langs:
FeatureNew('Adding Vala language without C', '0.59.0').use(self.subproject) if 'vala' in langs:
FeatureNew.single_use('Adding Vala language without C', '0.59.0', self.subproject)
args.append('c') args.append('c')
success = True success = True

Loading…
Cancel
Save