demos: add GResource examples in glib2 demo

This commit is contained in:
Damián Nohales 2014-09-21 13:49:07 -03:00 committed by Thomas Nagy
parent 9cd10fe885
commit 471e8faf6e
3 changed files with 17 additions and 2 deletions

1
demos/glib2/file.js Normal file
View File

@ -0,0 +1 @@
print('This is a resource file!')

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/glib2/test">
<file>file.js</file>
</gresource>
</gresources>

View File

@ -16,6 +16,8 @@ def configure(conf):
conf.check_cfg (package='glib-2.0', uselib_store='GLIB', atleast_version='2.25.0',
args='--cflags --libs')
conf.check_cfg (package='gio-2.0', uselib_store='GIO', atleast_version='2.25.0',
args='--cflags --libs')
conf.check_cfg (package='gobject-2.0', uselib_store='GOBJECT', atleast_version='2.25.0',
args='--cflags --libs')
@ -23,8 +25,8 @@ def configure(conf):
def build(bld):
app = bld (
features = 'c cprogram glib2',
use = 'GLIB GOBJECT',
source = 'main.c',
use = 'GLIB GIO GOBJECT',
source = 'main.c org.glib2.test.gresource.xml',
target = 'gsettings-test'
## An alternate way of doing this (no need to call add_ functions):
@ -38,3 +40,9 @@ def build(bld):
'org.gsettings.test-2.gschema.xml'])
app.add_marshal_file('marshal.list', 'test_marshal')
bld(
features = 'gresource',
source = 'org.glib2.test.gresource.xml',
install_path = 'lib/glib2_test'
)