| 1 |
project('c++ foolib', 'cpp', |
| 2 |
version : '1.0.0', |
| 3 |
license : 'MIT') |
| 4 |
add_global_arguments('-DSOME_TOKEN=value', language : 'cpp') |
| 5 |
glib_dep = dependency('glib-2.0') |
| 6 |
|
| 7 |
inc = include_directories('include') |
| 8 |
|
| 9 |
subdir('include') |
| 10 |
subdir('src') |
| 11 |
subdir('test') |
| 12 |
|
| 13 |
pkg_mod = import('pkgconfig') |
| 14 |
pkg_mod.generate(libraries : foolib, |
| 15 |
version : '1.0', |
| 16 |
name : 'libfoobar', |
| 17 |
filebase : 'foobar', |
| 18 |
description : 'A Library to barnicate your foos.') |
| 19 |
|
| 20 |
foo_sources = ['source1.cpp', 'source2.cpp'] |
| 21 |
foolib = shared_library('foo', |
| 22 |
foo_sources, |
| 23 |
include_directories : inc, |
| 24 |
dependencies : glib_dep, |
| 25 |
install : true) |
| 26 |
|
| 27 |
testexe = executable('testexe', 'footest.cpp', |
| 28 |
include_directories : inc, |
| 29 |
link_with : foolib) |
| 30 |
test('foolib test', testexe) |
| 31 |
|
| 32 |
mytarget = custom_target('targetname', |
| 33 |
output : outfile, |
| 34 |
input : infile, |
| 35 |
command : [comp, '@INPUT@', '@OUTPUT@'], |
| 36 |
install : true, |
| 37 |
install_dir : 'subdir') |
| 38 |
|
| 39 |
suites = [ |
| 40 |
{ 'suite': 'dbus-broker', 'env': ['DBUS_BROKER_TEST_BROKER=' + exe_dbus_broker.full_path()]}, |
| 41 |
] |
| 42 |
foreach suite : suites |
| 43 |
benchmark('Connection', bench_connect, timeout: 60, kwargs: suite) |
| 44 |
benchmark('Message passing', bench_message, timeout: 120, kwargs: suite) |
| 45 |
endforeach |
| 46 |
|
| 47 |
run_target('inspector', |
| 48 |
command : ['scripts/inspect.sh', '--exclude', 'tests']) |