meson: Build valtest

This commit is contained in:
Thibault Saunier 2017-08-31 17:36:55 -03:00
parent 4d513324cd
commit 74a4cf71e3
4 changed files with 52 additions and 2 deletions

View file

@ -37,8 +37,9 @@ if __name__ == "__main__":
shutil.copyfile(opts.api_raw, api_xml)
cmd = [opts.gapi_fixup, "--api=" + api_xml,
"--metadata=" + opts.metadata]
cmd = [opts.gapi_fixup, "--api=" + api_xml]
if opts.metadata:
cmd += ["--metadata=" + opts.metadata]
if opts.symbols:
cmd.extend(['--symbols=' + opts.symbols])
subprocess.check_call(cmd)

View file

@ -113,6 +113,7 @@ gtk_dep = dependency('gtk+-3.0', version: gtk_required_version, required: false)
if gtk_dep.found() and atk_dep.found() and pango_dep.found()
subdir('gtk')
subdir('sample/GtkDemo')
subdir('sample/valtest')
has_gtk = true
else
has_gtk = false

View file

@ -0,0 +1,33 @@
generated_sources = [
'Gtksharp_Valobj.cs',
]
source_gen = custom_target(assembly_name + 'codegen',
input: raw_api_fname,
output: generated_sources,
command: [
generate_api,
'--api-raw', '@INPUT@',
'--gapi-fixup', gapi_fixup.full_path(),
'--metadata', metadata_fname,
'--symbols', symbols,
'--gapi-codegen', gapi_codegen.full_path(),
'--extra-includes', glib_api_includes,
'--extra-includes', pango_api_includes,
'--extra-includes', gio_api_includes,
'--extra-includes', cairo_api_includes,
'--extra-includes', gdk_api_includes,
'--extra-includes', atk_api_includes,
'--extra-includes', gtk_api_includes,
'--out', meson.current_build_dir(),
'--files', ';'.join(generated_sources),
'--assembly-name', assembly_name,
'--schema', schema,
],
depends: [gapi_codegen, gapi_fixup])
api_xml = custom_target(pkg + '_api_xml',
input: raw_api_fname,
output: pkg + '-api.xml',
command: [generate_api, '--fakeglue'],
depends: [source_gen])

View file

@ -0,0 +1,15 @@
pkg = 'valobj'
assembly_name = pkg + '-sharp'
symbols = ''
raw_api_fname = join_paths(meson.current_source_dir(), pkg + '-api.xml')
metadata_fname = ''
vallib = library('valobj',
'valobj.c',
dependencies: [gtk_dep])
subdir('generated')
executable('valtest', 'Valtest.cs', source_gen,
cs_args: ['-unsafe'],
dependencies: [gtk_sharp_dep])