# HG changeset patch # User Chris Cannam # Date 1684496319 -3600 # Fri May 19 12:38:39 2023 +0100 # Node ID 5303511e7b86027c419e5b8208c55ea8d3466558 # Parent 2041cbd43cf7ce011435feadb12f08c0ef8d4974 # Parent 8f14da435ced183afa560ecc8846a98bb6c678b0 Merge from branch libatomic-check diff --git a/COMPILING.md b/COMPILING.md --- a/COMPILING.md +++ b/COMPILING.md @@ -320,7 +320,7 @@ Library Build option CPP define Notes ------- ------------ ---------- ----- -Built-in -Dfft=builtin -DUSE_BQRESAMPLER Default. +Built-in -Dresampler=builtin -DUSE_BQRESAMPLER Default. Intended to give high quality for time-varying pitch shifts in real-time mode. diff --git a/meson.build b/meson.build --- a/meson.build +++ b/meson.build @@ -131,6 +131,24 @@ args: '-lm') +# Do we need libatomic? +# +libatomic_dep = dependency('', required : false) +libatomic_test_program = ''' +#include +int main() { + std::atomic i; + std::atomic d; + return int(i.is_lock_free() && d.is_lock_free()); +} +''' +if cpp.compiles(libatomic_test_program, name : 'test program using std::atomic') + if (not cpp.links(libatomic_test_program, name : 'test program using std::atomic requires -latomic')) + libatomic_dep = cpp.find_library('atomic', required : true) + endif +endif + + # Find out whether we can build the optional JNI target. Thanks to Eli # Schwartz for the fix here; this has been through a few previous # iterations. Initially we just looked for jni.h, but it's often in an @@ -150,6 +168,11 @@ have_jni = false have_java = add_languages('java', required: get_option('jni')) if have_java + # At the time of writing this causes a spurious Meson warning: + # "Project targets '>= 0.53.0' but uses feature introduced in + # '0.62.0': dep 'jni' custom lookup." It's spurious because this + # syntax worked before 0.62 as well, it just didn't invoke the + # custom lookup jni_dep = dependency('jni', required: false) have_jni = cpp.has_header('jni.h', dependencies: jni_dep, args: extra_include_args) endif @@ -489,7 +512,7 @@ general_include_dirs += get_option('extra_include_dirs') general_compile_args = [ arch_flags, feature_defines ] -general_dependencies = [ feature_dependencies, thread_dep ] +general_dependencies = [ feature_dependencies, thread_dep, libatomic_dep ] rubberband_additional_static_lib = '' @@ -776,7 +799,7 @@ dependencies: [ rubberband_objlib_dep, general_dependencies, - sndfile_dep, + sndfile_dep ], install: true, ) diff --git a/src/finer/R3Stretcher.h b/src/finer/R3Stretcher.h --- a/src/finer/R3Stretcher.h +++ b/src/finer/R3Stretcher.h @@ -42,6 +42,7 @@ #include #include +#include namespace RubberBand {