diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/frameworks/7 gnome/resources/meson.build | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/frameworks/7 gnome/resources/meson.build')
-rw-r--r-- | meson/test cases/frameworks/7 gnome/resources/meson.build | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/meson/test cases/frameworks/7 gnome/resources/meson.build b/meson/test cases/frameworks/7 gnome/resources/meson.build new file mode 100644 index 000000000..b945cdaf6 --- /dev/null +++ b/meson/test cases/frameworks/7 gnome/resources/meson.build @@ -0,0 +1,55 @@ +# There are two tests here, because the 2nd one depends on a version of +# GLib (2.51.1) that is very recent at the time of writing. + +copyfile = find_program('copyfile.py') + +simple_gresource = configure_file( + input : 'simple.gresource.xml', + output : 'simple-gen.gresource.xml', + command : [copyfile, '@INPUT@', '@OUTPUT@']) + +simple_resources = gnome.compile_resources('simple-resources', + simple_gresource, + install_header : true, + export : true, + source_dir : '../resources-data', + c_name : 'simple_resources') + +simple_res_exe = executable('simple-resources-test', + 'simple-main.c', simple_resources, + dependencies: gio) +test('simple resource test', simple_res_exe) + +gnome.compile_resources('simple-resources', + 'simple.gresource.xml', + gresource_bundle: true, + install: true, + install_dir: get_option('datadir'), + source_dir : '../resources-data', +) +test('simple resource test (gresource)', find_program('resources.py')) + +if not pretend_glib_old and glib.version() >= '2.52.0' + # This test cannot pass if GLib version is older than 9.99.9. + # Meson will raise an error if the user tries to use the 'dependencies' + # argument and the version of GLib is too old for generated resource + # dependencies to work correctly. + generated_resources = gnome.compile_resources('generated-resources', + 'generated.gresource.xml', + source_dir : '../resources-data', + c_name : 'generated_resources', + dependencies : [res3_txt, res4_txt]) + + generated_res_exe = executable('generated-resources-test', + 'generated-main.c', generated_resources, + dependencies: gio) + test('generated resource test', generated_res_exe) +endif + +# Test build_by_default +gnome.compile_resources('build-resources', + 'simple.gresource.xml', + gresource_bundle : true, + build_by_default : true, + source_dir : '../resources-data', +) |