aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authormimi89999 <michel@lebihan.pl>2020-10-14 14:16:05 +0200
committerXavier Claessens <xclaesse@gmail.com>2020-10-15 08:09:51 -0400
commit4d140eb830eecee5f86430cce161370adb665868 (patch)
tree335c5b892f0e757666df1816ab172d8727010f1e /mesonbuild
parent7c377e5a5d1e413ea3494ceed0800985fcd804ae (diff)
downloadmeson-4d140eb830eecee5f86430cce161370adb665868.zip
meson-4d140eb830eecee5f86430cce161370adb665868.tar.gz
meson-4d140eb830eecee5f86430cce161370adb665868.tar.bz2
gnome: generate cpp gresource source in cpp projects
Closes #7839
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/modules/gnome.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 1faa128..4e6799f 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -157,8 +157,14 @@ class GnomeModule(ExtensionModule):
output = args[0] + '.gresource'
name = args[0] + '_gresource'
else:
- output = args[0] + '.c'
- name = args[0] + '_c'
+ if 'c' in state.environment.coredata.compilers.host.keys():
+ output = args[0] + '.c'
+ name = args[0] + '_c'
+ elif 'cpp' in state.environment.coredata.compilers.host.keys():
+ output = args[0] + '.cpp'
+ name = args[0] + '_cpp'
+ else:
+ raise MesonException('Compiling GResources into code is only supported in C and C++ projects')
if kwargs.get('install', False) and not gresource:
raise MesonException('The install kwarg only applies to gresource bundles, see install_header')