diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-06-11 14:36:33 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-06-11 14:36:33 +0530 |
commit | 1e42241ef3c9f4d7be70b7c44703cf8856a85ddd (patch) | |
tree | 783d4877ad5b69456e11cb49444d418d65539449 | |
parent | d38f3deaed52e592d9915e1b7970988ccb28eb7f (diff) | |
download | meson-1e42241ef3c9f4d7be70b7c44703cf8856a85ddd.zip meson-1e42241ef3c9f4d7be70b7c44703cf8856a85ddd.tar.gz meson-1e42241ef3c9f4d7be70b7c44703cf8856a85ddd.tar.bz2 |
gnome: Don't assume that a C compiler is being used
-rw-r--r-- | mesonbuild/modules/gnome.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 1822179..84ea679 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -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) |