]> git.sesse.net Git - nageru/blobdiff - meson.build
Add explicit check arguments to run_command, to fix a Meson warning.
[nageru] / meson.build
index 13be7585c1d0f976a29f6c9100169e5e1b2c06e9..0e1555e730e56b987263844526e2510119d58469 100644 (file)
@@ -1,4 +1,4 @@
-project('nageru', 'cpp', default_options: ['buildtype=debugoptimized'], version: '1.9.1')
+project('nageru', 'cpp', default_options: ['buildtype=debugoptimized'], version: '2.1.1-pre')
 
 cxx = meson.get_compiler('cpp')
 qt5 = import('qt5')
@@ -15,6 +15,7 @@ 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')
@@ -25,6 +26,7 @@ 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)
 sqlite3dep = dependency('sqlite3')
 threaddep = dependency('threads')
 vadrmdep = dependency('libva-drm')
@@ -56,6 +58,12 @@ if get_option('cef_dir') != ''
        add_project_arguments('-DHAVE_CEF=1', language: 'cpp')
 endif
 
+if srtdep.found()
+       # NOTE: Seemingly there's no way to figure out if we have OpenSSL libsrt
+       # or gnutls libsrt, so we cannot check license compatibility here.
+       add_project_arguments('-DHAVE_SRT=1', language: 'cpp')
+endif
+
 top_include = include_directories('.')
 
 subdir('shared')
@@ -66,7 +74,7 @@ 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]
+       qcustomplotdep, threaddep, eigendep, srtdep, libdrmdep]
 nageru_include_dirs = [include_directories('nageru')]
 nageru_link_with = []
 nageru_build_rpath = ''
@@ -98,9 +106,6 @@ if have_cef
                nageru_install_rpath = '$ORIGIN/'
        endif
 
-       cefdep = cxx.find_library('cef', dirs: cef_lib_dir)
-       nageru_deps += cefdep
-
        # CEF wrapper library; not built as part of the CEF binary distribution,
        # but should be if CEF is installed as a system library.
        if system_cef
@@ -132,17 +137,24 @@ if have_cef
        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,
+       # since upstream CEF searches for icudtl.dat in whatever path dladdr() says libcef.so
+       # comes from, and the upstream CEF tarballs have libcef.so and icudtl.dat in different
+       # directories. Thus, get both from the local symlinks we just created.
+       cefdep = cxx.find_library('cef', dirs: meson.current_build_dir())
+       nageru_deps += cefdep
 endif
 
 # bmusb.
@@ -202,7 +214,8 @@ nageru_srcs += ['nageru/chroma_subsampler.cpp', 'nageru/v210_converter.cpp', 'na
 # 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',
        '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/print_latency.cpp', 'nageru/basic_stats.cpp', 'nageru/ref_counted_frame.cpp',
+       'nageru/v4l_output.cpp']
 stream = static_library('stream', stream_srcs, dependencies: nageru_deps, include_directories: nageru_include_dirs)
 nageru_link_with += stream
 
@@ -225,7 +238,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)
@@ -264,7 +277,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.)
@@ -301,7 +314,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)