gnome: Don't assume that a C compiler is being used

This commit is contained in:
Nirbheek Chauhan 2017-06-11 14:36:33 +05:30
parent d38f3deaed
commit 1e42241ef3
1 changed files with 12 additions and 6 deletions

View File

@ -443,12 +443,18 @@ class GnomeModule(ExtensionModule):
'Gir includes must be str, GirTarget, or list of them')
cflags = []
if state.global_args.get('c'):
cflags += state.global_args['c']
if state.project_args.get('c'):
cflags += state.project_args['c']
if 'c' in state.compilers:
compiler = state.compilers['c']
for lang, compiler in girtarget.compilers.items():
# XXX: Can you use g-i with any other language?
if lang in ('c', 'cpp', 'objc', 'objcpp', 'd'):
break
else:
lang = None
compiler = None
if lang and compiler:
if state.global_args.get(lang):
cflags += state.global_args[lang]
if state.project_args.get(lang):
cflags += state.project_args[lang]
sanitize = compiler.get_options().get('b_sanitize')
if sanitize:
cflags += compilers.sanitizer_compile_args(sanitize)