--- a/meson.build 2020-01-04 02:27:45.000000000 +0100 +++ b/meson.build 2021-01-17 22:28:47.708483526 +0100 @@ -1,7 +1,8 @@ -project('noise-repellent','c',default_options: 'c_std=c99') +project('nrepel.lv2','c',default_options: 'c_std=c99') -#shared object name -lv2_name = 'nrepel' +sord_validate = find_program('sord_validate', native : true, required : false) +cp = find_program('cp') +clone = [cp, '@INPUT@', '@OUTPUT@'] #source to compile src = 'src/nrepel.c' @@ -13,19 +14,16 @@ lv2_dep = dependency('lv2', required : true) nr_dep = [m_dep,fftw_dep,lv2_dep] -#compiler optimization flags -if meson.get_compiler('c').get_id() == 'clang' - add_global_arguments('-mrecip', language : 'c') -endif -cflags = ['-ffast-math','-fomit-frame-pointer','-fno-finite-math-only'] -cflags += ['-Wno-unused-function'] +#compiler default flags +add_global_arguments('-ffast-math','-fomit-frame-pointer','-fno-finite-math-only','-Wno-unused-function',language : 'c') #install folder -install_folder = 'nrepel.lv2' +install_folder = join_paths(get_option('libdir'), 'lv2', meson.project_name()) #get the build operating system and configure install path and shared object extension current_os = build_machine.system() current_arch = build_machine.cpu_family() +cflags = [] # Add x86_64 optimization where appropriate (not for ARM) if current_arch != 'aarch64' @@ -34,7 +32,11 @@ # Add osx multiarch flags when appropriate if current_os == 'darwin' - cflags += ['-march=i386', '-march=x86-64','-mmacosx-version-min=10.5','-DMAC_OS_X_VERSION_MAX_ALLOWED=105'] + cflags += ['-mrecip', + '-march=i386', + '-march=x86-64', + '-mmacosx-version-min=10.5', + '-DMAC_OS_X_VERSION_MAX_ALLOWED=105'] endif # Extension for library by os @@ -48,7 +50,14 @@ endif #build of the shared object -shared_library(lv2_name,src,name_prefix: '',dependencies: nr_dep,c_args: cflags,install: true,install_dir : install_folder) +shared_library('nrepel', + src, + name_prefix: '', + dependencies: nr_dep, + c_args: cflags, + install: true, + install_dir : install_folder + ) #Configure manifest ttl in order to replace the correct shared object extension manifest_conf = configuration_data()