X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=meson.build;h=8114abbd1992711ccf17991c4c346992b5995d22;hp=a335f738507a31bb78dbf95a224d3e5f1768b41d;hb=HEAD;hpb=e1dc8c1d1d8a6082e0e28c444fe6ef73548f6035 diff --git a/meson.build b/meson.build index a335f73..b190b4a 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,6 @@ -project('nageru', 'cpp', default_options: ['buildtype=debugoptimized'], version: '2.0.1') +project('nageru', 'cpp', default_options: ['buildtype=debugoptimized'], version: '2.3.1-pre') + +add_project_arguments('-Wno-unqualified-std-cast-call', language: 'cpp') cxx = meson.get_compiler('cpp') qt5 = import('qt5') @@ -15,17 +17,18 @@ libavcodecdep = dependency('libavcodec') libavformatdep = dependency('libavformat') libswresampledep = dependency('libswresample') libavutildep = dependency('libavutil') +libdrmdep = dependency('libdrm') libjpegdep = dependency('libjpeg') libswscaledep = dependency('libswscale') libusbdep = dependency('libusb-1.0') luajitdep = dependency('luajit') movitdep = dependency('movit') protobufdep = dependency('protobuf') -qcustomplotdep = cxx.find_library('qcustomplot') qt5deps = dependency('qt5', modules: ['Core', 'Gui', 'Widgets', 'OpenGLExtensions', 'OpenGL', 'Network']) sdl2_imagedep = dependency('SDL2_image', required: false) sdl2dep = dependency('sdl2', required: false) srtdep = dependency('srt', required: false) +svtav1dep = dependency('SvtAv1Enc', required: false, version: '>=1.5.0') sqlite3dep = dependency('sqlite3') threaddep = dependency('threads') vadrmdep = dependency('libva-drm') @@ -62,6 +65,9 @@ if srtdep.found() # or gnutls libsrt, so we cannot check license compatibility here. add_project_arguments('-DHAVE_SRT=1', language: 'cpp') endif +if svtav1dep.found() + add_project_arguments('-DHAVE_AV1=1', language: 'cpp') +endif top_include = include_directories('.') @@ -72,8 +78,8 @@ subdir('shared') nageru_srcs = [] nageru_deps = [shareddep, qt5deps, libjpegdep, movitdep, protobufdep, vax11dep, vadrmdep, x11dep, libavformatdep, libswresampledep, libavcodecdep, libavutildep, - libswscaledep, libusbdep, luajitdep, dldep, x264dep, alsadep, zitaresamplerdep, - qcustomplotdep, threaddep, eigendep, srtdep] + libswscaledep, libusbdep, luajitdep, dldep, x264dep, svtav1dep, alsadep, zitaresamplerdep, + threaddep, eigendep, srtdep, libdrmdep] nageru_include_dirs = [include_directories('nageru')] nageru_link_with = [] nageru_build_rpath = '' @@ -116,36 +122,33 @@ if have_cef cef_dll_target = custom_target('libcef_dll_wrapper', input: join_paths(cef_dir, 'libcef_dll/CMakeLists.txt'), - output: ['libcef_dll_wrapper.a', 'cef-stamp'], + output: ['libcef_dll_wrapper.a'], command: [cef_compile_script, '@BUILD_DIR@', cef_dir, cmake, '@OUTPUT@']) - # Putting the .a in sources seemingly hits a bug where the .a files get sorted - # in the wrong order. This is a workaround; see - # https://github.com/mesonbuild/meson/issues/3613#issuecomment-408276296 . - cefdlldep = declare_dependency(sources: cef_dll_target[1], link_args: cef_dll_target.full_path()) + cefdlldep = declare_dependency(link_with: cef_dll_target) nageru_deps += cefdlldep endif cef_libs = ['libEGL.so', 'libGLESv2.so', 'snapshot_blob.bin', 'v8_context_snapshot.bin'] - cef_resources = ['cef.pak', 'cef_100_percent.pak', 'cef_200_percent.pak', 'cef_extensions.pak', 'devtools_resources.pak'] + cef_resources = ['resources.pak', 'chrome_100_percent.pak', 'chrome_200_percent.pak'] if not get_option('cef_no_icudtl') cef_resources += ['icudtl.dat'] endif if cef_build_type != 'system' - cef_libs += ['libcef.so'] + cef_libs += ['libcef.so', 'libEGL.so', 'libGLESv2.so', 'libvk_swiftshader.so', 'libvulkan.so.1', 'vk_swiftshader_icd.json'] endif # Symlink the files into the build directory, so that running nageru without ninja install works. - run_command('mkdir', join_paths(meson.current_build_dir(), 'locales/')) + run_command('mkdir', '-p', join_paths(meson.current_build_dir(), 'locales/'), check: true) foreach file : cef_libs - run_command('ln', '-s', join_paths(cef_lib_dir, file), meson.current_build_dir()) + run_command('ln', '-sf', join_paths(cef_lib_dir, file), meson.current_build_dir(), check: true) install_data(join_paths(cef_lib_dir, file), install_dir: exe_dir) endforeach foreach file : cef_resources - run_command('ln', '-s', join_paths(cef_resource_dir, file), meson.current_build_dir()) + run_command('ln', '-sf', join_paths(cef_resource_dir, file), meson.current_build_dir(), check: true) install_data(join_paths(cef_resource_dir, file), install_dir: exe_dir) endforeach - run_command('ln', '-s', join_paths(cef_resource_dir, 'locales/en-US.pak'), join_paths(meson.current_build_dir(), 'locales/')) + run_command('ln', '-sf', join_paths(cef_resource_dir, 'locales/en-US.pak'), join_paths(meson.current_build_dir(), 'locales/'), check: true) install_data(join_paths(cef_resource_dir, 'locales/en-US.pak'), install_dir: join_paths(exe_dir, 'locales')) # NOTE: We link against libcef.so in the local directory, _not_ in the CEF directory, @@ -184,7 +187,7 @@ nageru_link_with += protobuf_lib qt_files = qt5.preprocess( moc_headers: ['nageru/analyzer.h', 'nageru/clickable_label.h', 'nageru/compression_reduction_meter.h', 'nageru/correlation_meter.h', 'nageru/ellipsis_label.h', 'nageru/glwidget.h', 'nageru/input_mapping_dialog.h', 'nageru/lrameter.h', 'nageru/mainwindow.h', 'nageru/midi_mapping_dialog.h', - 'nageru/nonlinear_fader.h', 'nageru/vumeter.h'], + 'nageru/nonlinear_fader.h', 'nageru/vumeter.h', 'nageru/rgb_histogram.h'], ui_files: ['nageru/analyzer.ui', 'nageru/audio_expanded_view.ui', 'nageru/audio_miniview.ui', 'nageru/display.ui', 'nageru/input_mapping.ui', 'nageru/mainwindow.ui', 'nageru/midi_mapping.ui'], dependencies: qt5deps) @@ -192,7 +195,7 @@ qt_files = qt5.preprocess( # Qt objects. nageru_srcs += ['nageru/glwidget.cpp', 'nageru/mainwindow.cpp', 'nageru/vumeter.cpp', 'nageru/lrameter.cpp', 'nageru/compression_reduction_meter.cpp', 'nageru/correlation_meter.cpp', 'nageru/analyzer.cpp', 'nageru/input_mapping_dialog.cpp', 'nageru/midi_mapping_dialog.cpp', - 'nageru/nonlinear_fader.cpp', 'nageru/context_menus.cpp', 'nageru/vu_common.cpp', 'nageru/piecewise_interpolator.cpp', 'nageru/midi_mapper.cpp'] + 'nageru/nonlinear_fader.cpp', 'nageru/context_menus.cpp', 'nageru/vu_common.cpp', 'nageru/piecewise_interpolator.cpp', 'nageru/midi_mapper.cpp', 'nageru/rgb_histogram.cpp'] # Auxiliary objects used for nearly everything. aux_srcs = ['nageru/flags.cpp'] @@ -208,13 +211,17 @@ nageru_link_with += audio # Mixer objects. nageru_srcs += ['nageru/chroma_subsampler.cpp', 'nageru/v210_converter.cpp', 'nageru/mixer.cpp', 'nageru/pbo_frame_allocator.cpp', 'nageru/theme.cpp', 'nageru/scene.cpp', 'nageru/image_input.cpp', 'nageru/alsa_output.cpp', - 'nageru/timecode_renderer.cpp', 'nageru/tweaked_inputs.cpp', 'nageru/mjpeg_encoder.cpp'] + 'nageru/timecode_renderer.cpp', 'nageru/tweaked_inputs.cpp', 'nageru/mjpeg_encoder.cpp', 'nageru/srt_metrics.cpp'] # Streaming and encoding objects (largely the set that is shared between Nageru and Kaeru). -stream_srcs = ['nageru/quicksync_encoder.cpp', 'nageru/x264_encoder.cpp', 'nageru/x264_dynamic.cpp', 'nageru/x264_speed_control.cpp', 'nageru/video_encoder.cpp', +stream_srcs = ['nageru/quicksync_encoder.cpp', 'nageru/video_encoder.cpp', + 'nageru/x264_encoder.cpp', 'nageru/x264_dynamic.cpp', 'nageru/x264_speed_control.cpp', 'nageru/audio_encoder.cpp', 'nageru/ffmpeg_util.cpp', 'nageru/ffmpeg_capture.cpp', 'nageru/print_latency.cpp', 'nageru/basic_stats.cpp', 'nageru/ref_counted_frame.cpp', 'nageru/v4l_output.cpp'] +if svtav1dep.found() + stream_srcs += 'nageru/av1_encoder.cpp' +endif stream = static_library('stream', stream_srcs, dependencies: nageru_deps, include_directories: nageru_include_dirs) nageru_link_with += stream @@ -237,7 +244,7 @@ nageru_srcs += proto_generated # Shaders needed at runtime. shaders = ['nageru/cbcr_subsample.vert', 'nageru/cbcr_subsample.frag', 'nageru/uyvy_subsample.vert', 'nageru/uyvy_subsample.frag', 'nageru/v210_subsample.comp', 'nageru/timecode.vert', 'nageru/timecode.frag', 'nageru/timecode_10bit.frag'] foreach shader : shaders - run_command('ln', '-s', join_paths(meson.current_source_dir(), shader), meson.current_build_dir()) + run_command('ln', '-sf', join_paths(meson.current_source_dir(), shader), meson.current_build_dir(), check: true) endforeach nageru_shader_srcs = bin2h_gen.process(shaders) @@ -276,7 +283,7 @@ executable('benchmark_audio_mixer', 'nageru/benchmark_audio_mixer.cpp', dependen data_files = ['nageru/theme.lua', 'nageru/simple.lua', 'nageru/bg.jpeg', 'nageru/akai_midimix.midimapping', 'futatabi/behringer_cmd_pl1.midimapping'] install_data(data_files, install_dir: join_paths(get_option('prefix'), 'share/nageru')) foreach file : data_files - run_command('ln', '-s', join_paths(meson.current_source_dir(), file), meson.current_build_dir()) + run_command('ln', '-sf', join_paths(meson.current_source_dir(), file), meson.current_build_dir(), check: true) endforeach # Futatabi. (Not a subdir() because we don't want the output in nageru/nageru.) @@ -313,7 +320,7 @@ shaders += ['futatabi/add_base_flow.frag', 'futatabi/blend.frag', 'futatabi/chro 'futatabi/sobel.frag', 'futatabi/sor.frag', 'futatabi/splat.frag'] foreach shader : shaders - run_command('ln', '-s', join_paths(meson.current_source_dir(), shader), meson.current_build_dir()) + run_command('ln', '-sf', join_paths(meson.current_source_dir(), shader), meson.current_build_dir(), check: true) endforeach futatabi_shader_srcs = bin2h_gen.process(shaders)