diff --git a/ci_config.json b/ci_config.json index 0d9d57952..a6a06df35 100644 --- a/ci_config.json +++ b/ci_config.json @@ -790,6 +790,33 @@ "boost" ] }, + "miniaudio": { + "_comment": "Remove when fixed: https://github.com/xiph/opus/pull/285", + "fatal_warnings": false, + "_comment2": "Remove when fixed: https://github.com/xiph/opus/pull/287", + "test_options": [ + "--timeout-multiplier=2" + ], + "build_options": [ + "miniaudio:tests=enabled", + "miniaudio:tools=enabled", + "miniaudio:examples=enabled", + "miniaudio:libvorbis=auto", + "miniaudio:libopus=auto" + ], + "alpine_packages": [ + "opusfile-dev" + ], + "brew_packages": [ + "opusfile" + ], + "debian_packages": [ + "libopusfile-dev" + ], + "msys_packages": [ + "opusfile" + ] + }, "nanoarrow": { "alpine_packages": [ "apache-arrow-dev" diff --git a/releases.json b/releases.json index af54baa7b..84bef49b5 100644 --- a/releases.json +++ b/releases.json @@ -2456,6 +2456,14 @@ "2.0.0-1" ] }, + "miniaudio": { + "dependency_names": [ + "miniaudio" + ], + "versions": [ + "0.11.21-1" + ] + }, "miniz": { "dependency_names": [ "miniz" diff --git a/subprojects/miniaudio.wrap b/subprojects/miniaudio.wrap new file mode 100644 index 000000000..2e80e83ac --- /dev/null +++ b/subprojects/miniaudio.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = miniaudio-0.11.21 +source_url = https://github.com/mackron/miniaudio/archive/refs/tags/0.11.21.tar.gz +source_filename = v0.11.21.tar.gz +source_hash = 6afb5c231613d2fab4f1c668b7243ff9a7d6d78a7f5a2692c133f026fe508506 +patch_directory = miniaudio + +[provide] +dependency_names = miniaudio diff --git a/subprojects/packagefiles/miniaudio/examples/meson.build b/subprojects/packagefiles/miniaudio/examples/meson.build new file mode 100644 index 000000000..ef06a418a --- /dev/null +++ b/subprojects/packagefiles/miniaudio/examples/meson.build @@ -0,0 +1,248 @@ +ma_example_broken = disabler() + +sdl_dep = disabler() +if device_io.enabled() + sdl_dep = dependency('sdl2', required: false) + if sdl_dep.found() + executable( + 'custom_backend', + 'custom_backend.c', + dependencies: ma_sys_deps + ma_backend_deps + sdl_dep, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + endif +endif + +if decoding and device_io.enabled() and ( + opus_dep.found() + and opusfile_dep.found() + and vorbis_dep.found() + and vorbisfile_dep.found() +) + executable( + 'custom_decoder', + 'custom_decoder.c', + dependencies: ma_sys_deps + + ma_backend_deps + + [opus_dep, opusfile_dep, vorbis_dep, vorbisfile_dep], + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + + if engine and resource_manager.enabled() + executable( + 'custom_decoder_engine', + 'custom_decoder_engine.c', + dependencies: ma_sys_deps + + ma_backend_deps + + [opus_dep, opusfile_dep, vorbis_dep, vorbisfile_dep], + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + endif +endif + +if decoding and device_io.enabled() + executable( + 'data_source_chaining', + 'data_source_chaining.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif + +if node_graph.enabled() and device_io.enabled() + executable( + 'duplex_effect', + 'duplex_effect.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif + +if engine and device_io.enabled() and resource_manager.enabled() + executable( + 'engine_hello_world', + 'engine_hello_world.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + executable( + 'engine_advanced', + 'engine_advanced.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + if sdl_dep.found() + executable( + 'engine_sdl', + 'engine_sdl.c', + dependencies: ma_sys_deps + ma_backend_deps + sdl_dep, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + endif +endif + +if engine and node_graph.enabled() + executable( + 'engine_effects', + 'engine_effects.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif + +if engine + phonon_dep = dependency('phonon', required: false) + if phonon_dep.found() + executable( + 'engine_steamaudio', + 'engine_steamaudio.c', + dependencies: ma_sys_deps + ma_backend_deps + phonon_dep, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + endif +endif + +if device_io.enabled() and engine + executable( + 'hilo_interop', + 'hilo_interop.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif + +if node_graph.enabled() and decoding and device_io.enabled() + executable( + 'node_graph', + 'node_graph.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif + +if resource_manager.enabled() and device_io.enabled() + executable( + 'resource_manager', + 'resource_manager.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + executable( + 'resource_manager_advanced', + 'resource_manager_advanced.c', + # FIXME: resource_manager_advanced.c:194:37: + # error: ‘MA_RESOURCE_MANAGER_JOB_QUIT’ undeclared + ma_example_broken, + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif + +if device_io.enabled() and encoding + executable( + 'simple_capture', + 'simple_capture.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif +if device_io.enabled() + executable( + 'simple_duplex', + 'simple_duplex.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + executable( + 'simple_enumeration', + 'simple_enumeration.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif + +if device_io.enabled() and ( + 'wasapi' in backends + or (backends == ['_miniaudio_default'] and host_system == 'windows') +) + executable( + 'simple_loopback', + 'simple_loopback.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif + +if device_io.enabled() and decoding + executable( + 'simple_looping', + 'simple_looping.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + executable( + 'simple_mixing', + 'simple_mixing.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + executable( + 'simple_playback', + 'simple_playback.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif + +if device_io.enabled() and generation + executable( + 'simple_playback_sine', + 'simple_playback_sine.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) +endif diff --git a/subprojects/packagefiles/miniaudio/extras/meson.build b/subprojects/packagefiles/miniaudio/extras/meson.build new file mode 100644 index 000000000..8b5c9541e --- /dev/null +++ b/subprojects/packagefiles/miniaudio/extras/meson.build @@ -0,0 +1,75 @@ +ma_extras_c_args = ma_c_args +if cc.get_argument_syntax() == 'msvc' + ma_extras_c_args += '/FIminiaudio.h' +else + ma_extras_c_args += ['-include', 'miniaudio.h'] +endif + +ma_extra_srcs = [] + +opus_dep = dependency('opus', required: get_option('libopus')) +opusfile_dep = dependency('opusfile', required: get_option('libopus')) +if opus_dep.found() and opusfile_dep.found() + ma_all_libs += static_library( + 'miniaudio_libopus', + configure_file( + input: 'miniaudio_libopus.h', + output: 'miinaudio_libopus.c', + copy: true, + ), + extra_files: 'miniaudio_libopus.h', + dependencies: ma_sys_deps + [opus_dep, opusfile_dep], + c_args: ma_extras_c_args, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + pic: true, + ) +endif + +vorbis_dep = dependency('vorbis', required: get_option('libvorbis')) +vorbisfile_dep = dependency('vorbisfile', required: get_option('libvorbis')) +if vorbis_dep.found() and vorbisfile_dep.found() + ma_all_libs += static_library( + 'miniaudio_libvorbis', + configure_file( + input: 'miniaudio_libvorbis.h', + output: 'miinaudio_libvorbis.c', + copy: true, + ), + extra_files: 'miniaudio_libvorbis.h', + dependencies: ma_sys_deps + [vorbis_dep, vorbisfile_dep], + c_args: ma_extras_c_args, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + pic: true, + ) + + if get_option('stbvorbis') + warning( + 'you might want to disable the built-in stb_vorbis decoder to ensure the libvorbis decoder is picked.', + ) + endif +endif + +if get_option('stbvorbis') + stbvorbis_file = files('stb_vorbis.c') + ma_all_libs += static_library( + 'miniaudio_stbvorbis', + stbvorbis_file, + dependencies: ma_sys_deps, + c_args: ma_c_args, + install: false, + pic: true, + ) + + ma_extra_srcs += stbvorbis_file + ma_c_args += '-DSTB_VORBIS_HEADER_ONLY' +else + ma_c_args += '-DMA_NO_VORBIS' +endif + +if node_graph.enabled() + subdir('nodes') +endif diff --git a/subprojects/packagefiles/miniaudio/extras/nodes/meson.build b/subprojects/packagefiles/miniaudio/extras/nodes/meson.build new file mode 100644 index 000000000..92c6074a3 --- /dev/null +++ b/subprojects/packagefiles/miniaudio/extras/nodes/meson.build @@ -0,0 +1,35 @@ +foreach node : [ + 'ma_channel_combiner_node', + 'ma_channel_separator_node', + 'ma_ltrim_node', + 'ma_reverb_node', + 'ma_vocoder_node', +] + if ma_impl_workaround + ma_extra_srcs += files( + f'@node@/@node@.c', + ) + else + ma_all_libs += static_library( + node, + f'@node@/@node@.c', + dependencies: ma_sys_deps, + c_args: ma_extras_c_args, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + pic: true, + ) + endif + + if examples.allowed() and device_io.enabled() + executable( + f'@node@_example', + f'@node@/@node@_example.c', + dependencies: ma_sys_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ) + endif +endforeach diff --git a/subprojects/packagefiles/miniaudio/meson.build b/subprojects/packagefiles/miniaudio/meson.build new file mode 100644 index 000000000..7cea2e7bc --- /dev/null +++ b/subprojects/packagefiles/miniaudio/meson.build @@ -0,0 +1,282 @@ +project( + 'miniaudio', + 'c', + version: '0.11.21', + license: 'Unlicense OR MIT-0', + license_files: ['LICENSE'], + default_options: [ + 'warning_level=3', + 'c_std=gnu11,c11,gnu99,c99,gnu89,c89', + 'default_library=static', + ], + meson_version: '>=1.7.0', +) + +cc = meson.get_compiler('c') +host_system = host_machine.system() + +ma_c_args = [] + +backends = get_option('backends') +runtime_linking = get_option('runtime_linking').disable_auto_if( + # on darwin, disable runtime linking if not requested explictly, + # to avoid requesting extra entitlements. + host_system == 'darwin', +).enable_auto_if( + # enable runtime linking if backend is not specified. + '_meson_default' in backends, +) + +# features +decoding = get_option('decoding') +encoding = get_option('encoding') +device_io = get_option('device_io').enable_if(backends.length() > 0) +resource_manager = get_option('resource_manager').require(decoding) +engine = get_option('engine') +node_graph = get_option('node_graph').enable_if(engine) +threading = get_option('threading').enable_if(device_io.enabled()) +generation = get_option('generation') + +ma_global_args = [] +if not decoding + ma_global_args += '-DMA_NO_DECODING' +endif +if not encoding + ma_global_args += '-DMA_NO_ENCODING' +endif +if device_io.disabled() + ma_global_args += '-DMA_NO_DEVICE_IO' +endif +if resource_manager.disabled() + ma_global_args += '-DMA_NO_RESOURCE_MANAGER' +endif +if not engine + ma_global_args += '-DMA_NO_ENGINE' +endif +if node_graph.disabled() + ma_global_args += '-DMA_NO_NODE_GRAPH' +endif +if threading.disabled() + ma_global_args += '-DMA_NO_THREADING' +endif +if not generation + ma_global_args += '-DMA_NO_GENERATION' +endif + +add_project_arguments(ma_global_args, language: ['c', 'cpp']) + +# backend not specified? +if '_meson_default' in backends + if runtime_linking.disabled() + # opinionated. + # this does not reflect the default enabled / suppoted backends. + default_backends = { + 'darwin': ['coreaudio'], + 'linux': ['pulseaudio'], + 'openbsd': ['sndio', 'audio4'], + 'netbsd': ['audio4'], + 'freebsd': ['oss'], + 'dragonfly': ['oss'], + 'windows': ['wasapi', 'dsound', 'winmm'], + 'android': ['aaudio', 'opensl'], + 'emscripten': ['webaudio'], + } + if host_system in default_backends + backends = default_backends[host_system] + if host_system == 'emscripten' + # background thread is not properly supported. + # disable null backend explictly. + backends += ['custom'] + else + backends += ['custom', 'null'] + endif + else + error( + 'backend unknown at configuration time, but runtime linking is disabled.', + ) + endif + else + # enable all supported backends. + backends = ['_miniaudio_default'] + runtime_linking = runtime_linking.enable_if(true) + endif +endif + +assert('_meson_default' not in backends, 'default backends should be resolved') + +# TODO: use unbundled dr_libs +# https://github.com/mackron/miniaudio/issues/934 +if not get_option('dr_wav') + ma_c_args += '-DMA_NO_WAV' +endif +if not get_option('dr_flac') + ma_c_args += '-DMA_NO_FLAC' +endif +if not get_option('dr_mp3') + ma_c_args += '-DMA_NO_MP3' +endif + +examples = get_option('examples').enable_auto_if(meson.is_subproject()) +tools = get_option('tools').disable_auto_if(meson.is_subproject()) +tests = get_option('tests').enable_auto_if(meson.is_subproject()) + +ma_inc = include_directories('.') + +# required system dependencies. +ma_sys_deps = [] + +if host_system in [ + 'linux', + 'openbsd', + 'freebsd', + 'netbsd', + 'dragonfly', + 'android', + 'darwin', +] + if runtime_linking.enabled() + ma_sys_deps += dependency('dl') + endif + ma_sys_deps += dependency('threads', required: threading) + ma_sys_deps += dependency('atomic', required: threading) + ma_sys_deps += cc.find_library('m', required: false) +endif + +if backends != ['_miniaudio_default'] + ma_c_args += '-DMA_ENABLE_ONLY_SPECIFIC_BACKENDS' + foreach backend : backends + ma_c_args += '-DMA_ENABLE_' + backend.to_upper() + endforeach +endif + +ma_backend_deps = [] +if runtime_linking.disabled() + foreach runtime_backend : [ + 'wasapi', + 'dsound', + 'winmm', + + 'aaudio', + ] + if runtime_backend in backends + # NOTE: https://github.com/mackron/miniaudio/issues/935 + # not planned at the time. + error('runtime linking is required for backend', runtime_backend) + endif + endforeach + + ma_c_args += '-DMA_NO_RUNTIME_LINKING' + + if 'coreaudio' in backends + ma_backend_deps += dependency('appleframeworks', modules: ['foundation', 'coreaudio']) + audiotoolbox_dep = dependency('appleframeworks', modules: 'audiotoolbox', required: false) + + if audiotoolbox_dep.found() + ma_backend_deps += audiotoolbox_dep + else + audiounit_dep = dependency('appleframeworks', modules: 'audiounit', required: false) + if audiounit_dep.found() + ma_backend_deps += audiounit_dep + else + error('unable to find a suitable audio framework to link with') + endif + endif + endif + + if 'sndio' in backends + ma_backend_deps += dependency('sndio') + endif + if 'audio4' in backends + cc.has_header('sys/audioio.h', required: true) + endif + if 'oss' in backends + cc.has_header('sys/soundcard.h', required: true) + endif + + if 'pulseaudio' in backends + if cc.get_argument_syntax() == 'gcc' + # FIXME: argument qualifier types mismatch: + # error: initialization of ‘ma_pa_threaded_mainloop_get_retval_proc’ + # {aka ‘int (*)(pa_threaded_mainloop *)’} from incompatible pointer type + # ‘int (*)(const pa_threaded_mainloop *)’ [-Wincompatible-pointer-types] + ma_c_args += cc.first_supported_argument('-Wno-error=incompatible-pointer-types') + endif + ma_backend_deps += dependency('libpulse') + endif + if 'alsa' in backends + ma_backend_deps += dependency('alsa') + endif + if 'jack' in backends + ma_backend_deps += dependency('jack') + endif + + if 'opensl' in backends + ma_backend_deps += dependency('OpenSLES') + endif +endif + +# miniaudio + extra modules. +ma_all_libs = [] + +# FIXME: workaround impl-only defines when building in different TUs. +# need upstream changes to move the defines into header. +ma_impl_workaround = true + +subdir('extras') + +# NOTE: miniaudio_split will be _the_ only version of miniaudio starting from 0.12: +# https://github.com/mackron/miniaudio/issues/934#issuecomment-2628895596 +# this can be removed afterwards. +miniaudio_impl_src = configure_file( + input: 'miniaudio.h', + output: 'miniaudio_impl.c', + copy: true, +) +ma_impl_lib = static_library( + 'miniaudio_impl', + miniaudio_impl_src, + ma_extra_srcs, + extra_files: ['miniaudio.h'], + c_args: ['-DMINIAUDIO_IMPLEMENTATION'] + ma_c_args, + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + pic: true, + override_options: ma_impl_workaround ? [ + 'unity=on', + 'unity_size=32', # should be sufficient for now. + ] : [], +) +ma_all_libs += ma_impl_lib + +ma_lib = library( + 'miniaudio', + link_whole: ma_all_libs, + install: true, +) + +ma_dep = declare_dependency( + include_directories: ma_inc, + link_with: ma_lib, + compile_args: ma_global_args, +) + +pkg = import('pkgconfig') +pkg.generate( + ma_lib, + description: 'Audio playback and capture library written in C, in a single source file.', + url: 'https://miniaud.io', +) + +meson.override_dependency('miniaudio', ma_dep) + +if examples.allowed() + subdir('examples') +endif +if tools.allowed() + subdir('tools') +endif +if tests.allowed() + subdir('tests') +endif diff --git a/subprojects/packagefiles/miniaudio/meson_options.txt b/subprojects/packagefiles/miniaudio/meson_options.txt new file mode 100644 index 000000000..0648acc9f --- /dev/null +++ b/subprojects/packagefiles/miniaudio/meson_options.txt @@ -0,0 +1,136 @@ +option( + 'backends', + type: 'array', + choices: [ + 'wasapi', + 'dsound', + 'winmm', + 'alsa', + 'pulseaudio', + 'jack', + 'coreaudio', + 'sndio', + 'audio4', + 'oss', + 'aaudio', + 'opensl', + 'webaudio', + 'custom', + 'null', + '_meson_default', # use all available platform libs. force enables runtime linking. + ], + value: ['_meson_default'], + description: 'audio backends to enable', +) +option( + 'runtime_linking', + type: 'feature', + value: 'auto', + description: 'enable runtime linking', +) + +option( + 'decoding', + type: 'boolean', + value: true, + description: 'enable decoding APIs', +) +option( + 'encoding', + type: 'boolean', + value: true, + description: 'enable encoding APIs', +) +option( + 'device_io', + type: 'feature', + value: 'enabled', + description: 'enable playback and recording APIs', +) +option( + 'resource_manager', + type: 'feature', + value: 'enabled', + description: 'enable resource manager', +) +option( + 'node_graph', + type: 'feature', + value: 'enabled', + description: 'enable the node graph API', +) +option( + 'engine', + type: 'boolean', + value: true, + description: 'enable the engine API', +) +option( + 'threading', + type: 'feature', + value: 'auto', + description: 'enable the threading API', +) +option( + 'generation', + type: 'boolean', + value: true, + description: 'enable the generation API', +) + +option( + 'libvorbis', + type: 'feature', + value: 'disabled', + description: 'build with data source implementation that decodes Vorbis streams via libvorbis + libvorbisfile', +) +option( + 'libopus', + type: 'feature', + value: 'disabled', + description: 'build with data source implementation that decodes Opus streams via libopus + libopusfile', +) +option( + 'stbvorbis', + type: 'boolean', + value: false, + description: 'build with data source implementation that decodes Vorbis streams via stb_vorbis', +) + +option( + 'dr_wav', + type: 'boolean', + value: true, + description: 'enable built-in wav decoder and encoder', +) +option( + 'dr_flac', + type: 'boolean', + value: true, + description: 'enable built-in flac decoder', +) +option( + 'dr_mp3', + type: 'boolean', + value: true, + description: 'enable built-in mp3 decoder', +) + +option( + 'examples', + type: 'feature', + value: 'auto', + description: 'build examples', +) +option( + 'tools', + type: 'feature', + value: 'auto', + description: 'build tools', +) +option( + 'tests', + type: 'feature', + value: 'auto', + description: 'build and run tests', +) diff --git a/subprojects/packagefiles/miniaudio/tests/meson.build b/subprojects/packagefiles/miniaudio/tests/meson.build new file mode 100644 index 000000000..a98c3d04b --- /dev/null +++ b/subprojects/packagefiles/miniaudio/tests/meson.build @@ -0,0 +1,88 @@ +ma_test_broken = disabler() + +test( + 'automated', + executable( + 'ma_test_automated', + 'test_automated/ma_test_automated.c', + dependencies: ma_sys_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ), + workdir: meson.current_source_dir() / '_build', +) + +if device_io.enabled() and encoding and decoding and generation + # FIXME: implement test driver for deviceio + ma_headless_driver = disabler() + + test( + 'deviceio', + executable( + 'ma_test_deviceio', + 'test_deviceio/ma_test_deviceio.c', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ), + depends: ma_headless_driver, + is_parallel: false, + workdir: meson.current_source_dir() / '_build', + ) + if add_languages('cpp', native: false, required: false) + test( + 'deviceio_cpp', + executable( + 'ma_test_cpp', + 'test_cpp/ma_test_cpp.cpp', + dependencies: ma_sys_deps + ma_backend_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ), + depends: ma_headless_driver, + is_parallel: false, + workdir: meson.current_source_dir() / '_build', + ) + endif +endif + +if encoding and decoding + test( + 'filtering', + executable( + 'ma_test_filtering', + 'test_filtering/ma_test_filtering.c', + dependencies: ma_sys_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ), + # FIXME: FAILURE: test_bpf4__f32, test_bpf4__s16 + # ma_bpf_reinit__internal -> ma_bpf2_init_preallocated: + # pBPF->pBPF2 is always NULL? + depends: ma_test_broken, + args: files('_build/res/sine_s16_mono_48000.wav'), + workdir: meson.current_source_dir() / '_build', + ) +endif + +if generation + test( + 'generation', + executable( + 'ma_test_generation', + 'test_generation/ma_test_generation.c', + dependencies: ma_sys_deps, + install: false, + implicit_include_directories: false, + include_directories: ma_inc, + ), + # FIXME: wrong path: + # https://github.com/mackron/miniaudio/pull/936/commits/7583e2ca56039ed4a6ce0418a82b4aa888a76fff + depends: ma_test_broken, + workdir: meson.current_source_dir() / '_build', + ) +endif diff --git a/subprojects/packagefiles/miniaudio/tools/meson.build b/subprojects/packagefiles/miniaudio/tools/meson.build new file mode 100644 index 000000000..09de76437 --- /dev/null +++ b/subprojects/packagefiles/miniaudio/tools/meson.build @@ -0,0 +1,13 @@ +if decoding and encoding + audioconverter_exe = executable( + 'audioconverter', + 'audioconverter/audioconverter.c', + dependencies: ma_sys_deps, + install: true, + implicit_include_directories: false, + include_directories: ma_inc, + ) + if not meson.is_cross_build() + meson.override_find_program('audioconverter', audioconverter_exe) + endif +endif