]> git.sesse.net Git - nageru/blob - shared/meson.build
5653528521b290e12c944a0640c75beb54cdb469
[nageru] / shared / meson.build
1 qt5 = import('qt5')
2 shared_qt5deps = dependency('qt5', modules: ['Core', 'Gui', 'Widgets', 'OpenGL'])
3 libmicrohttpddep = dependency('libmicrohttpd')
4 protobufdep = dependency('protobuf')
5 alsadep = dependency('alsa')
6
7 # Preprocess Qt as needed.
8 qt_files = qt5.preprocess(
9         moc_headers: ['aboutdialog.h', 'controller_spin_box.h'],
10         ui_files: ['aboutdialog.ui'],
11         dependencies: shared_qt5deps)
12
13 # Protobuf compilation.
14 gen = generator(protoc, \
15         output    : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
16         arguments : ['--proto_path=@CURRENT_SOURCE_DIR@', '--cpp_out=@BUILD_DIR@', '@INPUT@'])
17 proto_generated = gen.process(['midi_mapping.proto'])
18 protobuf_lib = static_library('protobufs', proto_generated, dependencies: [protobufdep])
19 protobuf_hdrs = declare_dependency(sources: proto_generated)
20
21 srcs = ['memcpy_interleaved.cpp', 'metacube2.cpp', 'ffmpeg_raii.cpp', 'mux.cpp', 'metrics.cpp', 'context.cpp', 'httpd.cpp', 'disk_space_estimator.cpp', 'read_file.cpp', 'text_proto.cpp', 'midi_device.cpp']
22 srcs += proto_generated
23
24 # Qt objects.
25 srcs += qt_files
26 srcs += ['aboutdialog.cpp']
27
28 shared = static_library('shared', srcs, include_directories: top_include, dependencies: [shared_qt5deps, libmicrohttpddep, protobufdep, alsadep])
29 shareddep = declare_dependency(
30    sources: proto_generated,
31    include_directories: top_include,
32    link_with: [shared, protobuf_lib])
33
34 bin2h = executable('bin2h', 'bin2h.cpp', native: true)
35 bin2h_gen = generator(bin2h, \
36   output    : ['@PLAINNAME@.cpp'],
37   arguments : ['@INPUT@', '@PLAINNAME@', '@OUTPUT@'])