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
|
# examples/others
# input: gnome, gtkmm_dep, build_examples_by_default, copy_to_subdir,
# meson_backend, test_timeout, project_build_root, python3
# input and output: examples_targets
examples_others = [
# [[dir-name], exe-name, [sources]]
[['calendar'], 'calendar', ['calendar.cc']],
[['dnd'], 'testdnd', ['dndwindow.cc', 'main.cc']],
[['exception'], 'exceptiontest', ['exceptiontest.cc']],
[['tictactoe'], 'ttt_test', ['tictactoe.cc', 'ttt_test.cc']],
[['window'], 'wheelbarrow', ['wheelbarrow.cc']],
]
foreach ex : examples_others
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: gtkmm_dep,
win_subsystem: 'windows',
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
)
target_name = 'examples' / 'others' / stamp_file_name
test('others_' + ex_name, meson_backend,
args: target_name,
workdir: project_build_root,
timeout: test_timeout
)
endforeach
|