1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
# examples/book/giomm
# input: gnome, giomm_dep, build_examples_by_default, copy_to_subdir,
# meson_backend, project_build_root, python3
# input and output: examples_targets
examples_book_giomm = [
# [[dir-name], exe-name, [sources]]
[['directory_list'], 'example', ['main.cc']],
[['getline'], 'example', ['getline.cc']],
[['monitor_directory'], 'monitor_directory', ['monitor_directory.cc']],
[['read_file'], 'example', ['main.cc']],
[['read_file_async'], 'example', ['main.cc']],
[['usage'], 'usage', ['usage.cc']],
[['volumes'], 'example', ['main.cc']],
[['write_file'], 'example', ['main.cc']],
]
foreach ex : examples_book_giomm
dir = ''
foreach dir_part : ex[0]
dir = dir / dir_part
endforeach
ex_name = (dir / ex[1]).underscorify()
ex_sources = []
resources = []
foreach src : ex[2]
if src.endswith('.gresource.xml')
resources = gnome.compile_resources(dir.underscorify() + '_resources',
dir / src,
source_dir: dir
)
else
ex_sources += dir / src
endif
endforeach
exe_file = executable(ex_name, ex_sources, resources,
dependencies: giomm_dep,
win_subsystem: 'console',
build_by_default: build_examples_by_default
)
stamp_file_name = ex_name + '_copy.stamp'
examples_targets += custom_target(stamp_file_name,
input: exe_file,
output: stamp_file_name,
command: [
python3, copy_to_subdir,
'@INPUT@',
dir,
ex[1],
'@OUTPUT@',
],
build_by_default: build_examples_by_default
)
# These example programs build quite fast. No need for extra timeout time.
target_name = 'examples' / 'book' / 'giomm' / stamp_file_name
test('book_giomm_' + ex_name, meson_backend,
args: target_name,
workdir: project_build_root
)
endforeach
|