| 1 |
project('protocol buffer test', 'cpp', default_options: ['cpp_std=c++17']) |
| 2 |
|
| 3 |
protoc = find_program('protoc', required : false) |
| 4 |
dep = dependency('protobuf', required : false) |
| 5 |
|
| 6 |
if not protoc.found() or not dep.found() |
| 7 |
error('MESON_SKIP_TEST: protoc tool and/or protobuf pkg-config dependency not found') |
| 8 |
endif |
| 9 |
|
| 10 |
|
| 11 |
gen = generator(protoc, \ |
| 12 |
output : ['@[email protected]', '@[email protected]'], |
| 13 |
arguments : ['--proto_path=@CURRENT_SOURCE_DIR@', '--cpp_out=@BUILD_DIR@', '@INPUT@']) |
| 14 |
|
| 15 |
generated = gen.process('defs.proto') |
| 16 |
e = executable('prog', 'main.cpp', generated, |
| 17 |
dependencies : dep) |
| 18 |
test('prototest', e) |
| 19 |
|
| 20 |
subdir('asubdir') |
| 21 |
subdir('withpath') |
| 22 |
subdir('sidedir') |