]> git.sesse.net Git - nageru/blobdiff - nageru/meson.build
Give Futatabi an about/license dialog, and the same manual link as Nageru.
[nageru] / nageru / meson.build
index bc93a2839c35992353665a9c54e9cccf636316e8..6d31a4d556d4be2e9d3d4e4d1bfd6c05df2e590d 100644 (file)
@@ -2,15 +2,6 @@ qt5 = import('qt5')
 protoc = find_program('protoc')
 cxx = meson.get_compiler('cpp')
 
-# Use lld if we can; it links a lot faster than ld.bfd or gold.
-nageru_link_args = []
-code = '''#include <stdio.h>
-int main() { printf("Hello, world!\n"); return 0; }
-'''
-if cxx.links(code, args: '-fuse-ld=lld', name: 'check for LLD')
-       nageru_link_args += '-fuse-ld=lld'
-endif
-
 embedded_bmusb = get_option('embedded_bmusb')
 
 alsadep = dependency('alsa')
@@ -22,7 +13,6 @@ libavformatdep = dependency('libavformat')
 libavresampledep = dependency('libavresample')
 libavutildep = dependency('libavutil')
 libjpegdep = dependency('libjpeg')
-libmicrohttpddep = dependency('libmicrohttpd')
 libswscaledep = dependency('libswscale')
 libusbdep = dependency('libusb-1.0')
 luajitdep = dependency('luajit')
@@ -38,7 +28,7 @@ x264dep = dependency('x264')
 zitaresamplerdep = cxx.find_library('zita-resampler')
 
 srcs = []
-nageru_deps = [qt5deps, libjpegdep, movitdep, libmicrohttpddep, protobufdep,
+nageru_deps = [shareddep, qt5deps, libjpegdep, movitdep, protobufdep,
        vax11dep, vadrmdep, x11dep, libavformatdep, libavresampledep, libavcodecdep, libavutildep,
        libswscaledep, libusbdep, luajitdep, dldep, x264dep, alsadep, zitaresamplerdep,
        qcustomplotdep, threaddep]
@@ -50,31 +40,14 @@ nageru_install_rpath = ''
 kaeru_link_with = []
 kaeru_extra_deps = []
 
-# DeckLink has these issues, and we include it from various places.
-if cxx.has_argument('-Wno-non-virtual-dtor')
-       add_project_arguments('-Wno-non-virtual-dtor', language: 'cpp')
-endif
-
-# FFmpeg has a lot of deprecated APIs whose replacements are not available
-# in Debian stable, so we suppress these warnings.
-if cxx.has_argument('-Wno-deprecated-declarations')
-       add_project_arguments('-Wno-deprecated-declarations', language: 'cpp')
-endif
-
-# Add the right MOVIT_SHADER_DIR definition.
-r = run_command('pkg-config', '--variable=shaderdir', 'movit')
-if r.returncode() != 0
-       error('Movit pkg-config installation is broken.')
-endif
-add_project_arguments('-DMOVIT_SHADER_DIR="' + r.stdout().strip() + '"', language: 'cpp')
-
 # CEF.
 exe_dir = join_paths(get_option('prefix'), 'lib/nageru')
 cef_dir = get_option('cef_dir')
 cef_build_type = get_option('cef_build_type')
 have_cef = (cef_dir != '')
 if have_cef
-       add_project_arguments('-DHAVE_CEF=1', language: 'cpp')
+       # This is done in the top-level file; just kept here for reference.
+       # add_project_arguments('-DHAVE_CEF=1', language: 'cpp')
 
        system_cef = (cef_build_type == 'system')
        if system_cef
@@ -163,20 +136,20 @@ nageru_link_with += protobuf_lib
 
 # Preprocess Qt as needed.
 qt_files = qt5.preprocess(
-       moc_headers: ['aboutdialog.h', 'analyzer.h', 'clickable_label.h', 'compression_reduction_meter.h', 'correlation_meter.h',
+       moc_headers: ['analyzer.h', 'clickable_label.h', 'compression_reduction_meter.h', 'correlation_meter.h',
                'ellipsis_label.h', 'glwidget.h', 'input_mapping_dialog.h', 'lrameter.h', 'mainwindow.h', 'midi_mapping_dialog.h',
                'nonlinear_fader.h', 'vumeter.h'],
-       ui_files: ['aboutdialog.ui', 'analyzer.ui', 'audio_expanded_view.ui', 'audio_miniview.ui', 'display.ui',
+       ui_files: ['analyzer.ui', 'audio_expanded_view.ui', 'audio_miniview.ui', 'display.ui',
                'input_mapping.ui', 'mainwindow.ui', 'midi_mapping.ui'],
        dependencies: qt5deps)
 
 # Qt objects.
 srcs += ['glwidget.cpp', 'mainwindow.cpp', 'vumeter.cpp', 'lrameter.cpp', 'compression_reduction_meter.cpp',
-       'correlation_meter.cpp', 'aboutdialog.cpp', 'analyzer.cpp', 'input_mapping_dialog.cpp', 'midi_mapping_dialog.cpp',
+       'correlation_meter.cpp', 'analyzer.cpp', 'input_mapping_dialog.cpp', 'midi_mapping_dialog.cpp',
        'nonlinear_fader.cpp', 'context_menus.cpp', 'vu_common.cpp', 'piecewise_interpolator.cpp', 'midi_mapper.cpp']
 
 # Auxiliary objects used for nearly everything.
-aux_srcs = ['metrics.cpp', 'flags.cpp']
+aux_srcs = ['flags.cpp']
 aux = static_library('aux', aux_srcs, dependencies: nageru_deps, include_directories: nageru_include_dirs)
 nageru_link_with += aux
 
@@ -188,18 +161,18 @@ nageru_link_with += audio
 
 # Mixer objects.
 srcs += ['chroma_subsampler.cpp', 'v210_converter.cpp', 'mixer.cpp', 'pbo_frame_allocator.cpp',
-       'context.cpp', 'theme.cpp', 'image_input.cpp', 'alsa_output.cpp',
-       'disk_space_estimator.cpp', 'timecode_renderer.cpp', 'tweaked_inputs.cpp']
+       'theme.cpp', 'image_input.cpp', 'alsa_output.cpp',
+       'timecode_renderer.cpp', 'tweaked_inputs.cpp', 'mjpeg_encoder.cpp']
 
 # Streaming and encoding objects (largely the set that is shared between Nageru and Kaeru).
 stream_srcs = ['quicksync_encoder.cpp', 'x264_encoder.cpp', 'x264_dynamic.cpp', 'x264_speed_control.cpp', 'video_encoder.cpp',
-       'metacube2.cpp', 'mux.cpp', 'audio_encoder.cpp', 'ffmpeg_raii.cpp', 'ffmpeg_util.cpp', 'httpd.cpp', 'ffmpeg_capture.cpp',
+       'audio_encoder.cpp', 'ffmpeg_util.cpp', 'ffmpeg_capture.cpp',
        'print_latency.cpp', 'basic_stats.cpp', 'ref_counted_frame.cpp']
 stream = static_library('stream', stream_srcs, dependencies: nageru_deps, include_directories: nageru_include_dirs)
 nageru_link_with += stream
 
 # DeckLink.
-srcs += ['decklink_capture.cpp', 'decklink_util.cpp', 'decklink_output.cpp', 'memcpy_interleaved.cpp',
+srcs += ['decklink_capture.cpp', 'decklink_util.cpp', 'decklink_output.cpp',
        'decklink/DeckLinkAPIDispatch.cpp']
 decklink_dir = include_directories('decklink')
 nageru_include_dirs += decklink_dir
@@ -212,6 +185,15 @@ endif
 srcs += qt_files
 srcs += proto_generated
 
+# Shaders needed at runtime.
+shaders = ['cbcr_subsample.vert', 'cbcr_subsample.frag', 'uyvy_subsample.vert', 'uyvy_subsample.frag', 'v210_subsample.comp', 'timecode.vert', 'timecode.frag', 'timecode_10bit.frag']
+foreach shader : shaders
+  run_command('ln', '-s', join_paths(meson.current_source_dir(), shader), meson.current_build_dir())
+endforeach
+
+shader_srcs = bin2h_gen.process(shaders)
+srcs += shader_srcs
+
 # Everything except main.cpp. (We do this because if you specify a .cpp file in
 # both Nageru and Kaeru, it gets compiled twice. In the older Makefiles, Kaeru
 # depended on a smaller set of objects.)
@@ -224,7 +206,6 @@ executable('nageru', 'main.cpp',
        dependencies: nageru_deps,
        include_directories: nageru_include_dirs,
        link_with: nageru_link_with,
-       link_args: nageru_link_args,
        build_rpath: nageru_build_rpath,
        install_rpath: nageru_install_rpath,
        install: true,
@@ -237,11 +218,10 @@ executable('kaeru', 'kaeru.cpp',
        dependencies: [nageru_deps, kaeru_extra_deps],
        include_directories: nageru_include_dirs,
        link_with: [stream, aux, kaeru_link_with],
-       link_args: nageru_link_args,
        install: true)
 
 # Audio mixer microbenchmark.
-executable('benchmark_audio_mixer', 'benchmark_audio_mixer.cpp', dependencies: nageru_deps, include_directories: nageru_include_dirs, link_args: nageru_link_args, link_with: [audio, aux])
+executable('benchmark_audio_mixer', 'benchmark_audio_mixer.cpp', dependencies: nageru_deps, include_directories: nageru_include_dirs, link_with: [audio, aux])
 
 # These are needed for a default run.
 data_files = ['theme.lua', 'simple.lua', 'bg.jpeg', 'akai_midimix.midimapping']