parent
c0f097c0c7
commit
3f46cd7fb3
12 changed files with 65 additions and 48 deletions
@ -1,12 +0,0 @@ |
||||
project('glib compile resource', 'c') |
||||
|
||||
gnome = import('gnome') |
||||
gio = dependency('gio-2.0') |
||||
|
||||
myres = gnome.compile_resources('myresources', 'myresource.gresource.xml', |
||||
source_dir : 'data', |
||||
c_name : 'myres') |
||||
|
||||
exe = executable('resprog', 'main.c', myres, |
||||
dependencies : gio) |
||||
test('resource test', exe) |
@ -1,35 +0,0 @@ |
||||
project('gobject-introspection', 'c') |
||||
|
||||
glib = dependency('glib-2.0') |
||||
gobj = dependency('gobject-2.0') |
||||
gir = dependency('gobject-introspection-1.0') |
||||
gmod = dependency('gmodule-2.0') |
||||
|
||||
girscan = find_program('g-ir-scanner') |
||||
girc = find_program('g-ir-compiler') |
||||
|
||||
libsources = ['golib.c', 'golib.h'] |
||||
|
||||
exe = executable('goprog', libsources, 'prog.c', |
||||
dependencies : [glib, gobj, gir, gmod]) |
||||
|
||||
test('gobjtest', exe) |
||||
|
||||
# Let's create Gir data with custom targets to prove that |
||||
# Meson's syntax is expressive enough. |
||||
r = run_command('pkg-config', '--cflags', 'gobject-introspection-1.0') |
||||
custom_gir_args = r.stdout().strip().split() |
||||
|
||||
golibgir = custom_target('golibgir', |
||||
output : 'Meson-1.0.gir', |
||||
input : libsources, |
||||
command : [girscan, '@INPUT@', '--program', exe, custom_gir_args, '--include=GObject-2.0', |
||||
'--namespace=Meson', '--nsversion=1.0', '--output', '@OUTPUT@'], |
||||
) |
||||
|
||||
custom_target('golibtypelib', |
||||
output : 'Meson-1.0.typelib', |
||||
command : [girc, golibgir,'--output', '@OUTPUT@'], |
||||
install : true, |
||||
install_dir : 'typelibdir' |
||||
) |
@ -0,0 +1,31 @@ |
||||
project('gobject-introspection', 'c') |
||||
|
||||
gnome = import('gnome') |
||||
gio = dependency('gio-2.0') |
||||
glib = dependency('glib-2.0') |
||||
gobj = dependency('gobject-2.0') |
||||
gir = dependency('gobject-introspection-1.0') |
||||
gmod = dependency('gmodule-2.0') |
||||
|
||||
myres = gnome.compile_resources('myresources', 'myresource.gresource.xml', |
||||
source_dir : 'data', |
||||
c_name : 'myres') |
||||
|
||||
resexe = executable('resprog', 'main.c', myres, |
||||
dependencies : gio) |
||||
test('resource test', resexe) |
||||
|
||||
libsources = ['golib.c', 'golib.h'] |
||||
|
||||
girexe = executable('girprog', libsources, 'prog.c', |
||||
dependencies : [glib, gobj, gir, gmod]) |
||||
|
||||
gnome.generate_gir(girexe, |
||||
sources : libsources, |
||||
nsversion : '1.0', |
||||
namespace : 'Meson', |
||||
install : true, |
||||
install_dir : 'typelibdir', |
||||
) |
||||
|
||||
test('gobject introspection', girexe) |
Loading…
Reference in new issue