meson.build 628 B

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