-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vala: fixes to gresource handling (#12418)
* Vala: depend on gresources Valac uses gresource at compile time to look up .ui files * Automatically pass `--gresourcesdir` to valac * gnome.compile_resources: clean up duplicate paths better * Add a test for improved gresouce handling
- Loading branch information
Showing
7 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<interface> | ||
<requires lib="gtk" version="3.0"/> | ||
<template class="TestBox" parent="GtkBox"> | ||
</template> | ||
</interface> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
project('demo', 'c', 'vala') | ||
|
||
gnome = import('gnome', required: false) | ||
|
||
if not gnome.found() | ||
error('MESON_SKIP_TEST: gnome module not supported') | ||
endif | ||
|
||
deps = [ | ||
dependency('glib-2.0', version : '>=2.50'), | ||
dependency('gobject-2.0'), | ||
dependency('gtk+-3.0'), | ||
] | ||
|
||
ui_tgt = custom_target( | ||
input: 'TestBox.ui.in', | ||
output: 'TestBox.ui', | ||
command: [find_program('cat')], | ||
feed: true, | ||
capture: true, | ||
) | ||
|
||
resources = gnome.compile_resources('test-resources', | ||
'test.gresource.xml', | ||
c_name: 'test_res', | ||
dependencies: ui_tgt, | ||
) | ||
|
||
executable( | ||
'demo', | ||
'test.vala', | ||
resources, | ||
dependencies: deps, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<gresources> | ||
<gresource prefix="/com/mesonbuild/test"> | ||
<file>TestBox.ui</file> | ||
</gresource> | ||
</gresources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[GtkTemplate (ui = "/com/mesonbuild/test/TestBox.ui")] | ||
class TestBox: Gtk.Box { | ||
} | ||
|
||
int main() { | ||
return 0; | ||
} |