Windows build fixes
This commit is contained in:
192
meson.build
192
meson.build
@@ -63,6 +63,13 @@ program_sources = [
|
|||||||
'main/main.cpp',
|
'main/main.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if system == 'windows'
|
||||||
|
program_sources += [
|
||||||
|
'src/getopt/getopt.c',
|
||||||
|
'src/getopt/getopt_long.c'
|
||||||
|
]
|
||||||
|
endif
|
||||||
|
|
||||||
vamp_sources = [
|
vamp_sources = [
|
||||||
'vamp/RubberBandVampPlugin.cpp',
|
'vamp/RubberBandVampPlugin.cpp',
|
||||||
'vamp/libmain.cpp',
|
'vamp/libmain.cpp',
|
||||||
@@ -103,6 +110,7 @@ arch_flags = []
|
|||||||
resampler = get_option('resampler')
|
resampler = get_option('resampler')
|
||||||
fft = get_option('fft')
|
fft = get_option('fft')
|
||||||
ipp_path = get_option('ipp_path')
|
ipp_path = get_option('ipp_path')
|
||||||
|
ipp_needed = false
|
||||||
|
|
||||||
if fft == 'auto'
|
if fft == 'auto'
|
||||||
if system == 'darwin'
|
if system == 'darwin'
|
||||||
@@ -120,7 +128,10 @@ if resampler == 'auto'
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ipp_needed = false
|
extra_include_args = []
|
||||||
|
foreach d: get_option('extra_include_dirs')
|
||||||
|
extra_include_args += '-I' + d
|
||||||
|
endforeach
|
||||||
|
|
||||||
if fft == 'kissfft'
|
if fft == 'kissfft'
|
||||||
message('For FFT: using KissFFT')
|
message('For FFT: using KissFFT')
|
||||||
@@ -133,12 +144,16 @@ if fft == 'kissfft'
|
|||||||
elif fft == 'fftw'
|
elif fft == 'fftw'
|
||||||
if fftw3_dep.found()
|
if fftw3_dep.found()
|
||||||
message('For FFT: using FFTW')
|
message('For FFT: using FFTW')
|
||||||
|
pkgconfig_requirements += fftw3_dep
|
||||||
else
|
else
|
||||||
error('For FFT: FFTW selected, but dependency not found')
|
fftw_dep = cpp.find_library('fftw3',
|
||||||
|
dirs: get_option('extra_lib_dirs'),
|
||||||
|
has_headers: ['fftw3.h'],
|
||||||
|
header_args: extra_include_args,
|
||||||
|
required: true)
|
||||||
endif
|
endif
|
||||||
feature_dependencies += fftw3_dep
|
feature_dependencies += fftw3_dep
|
||||||
feature_defines += ['-DHAVE_FFTW3', '-DFFTW_DOUBLE_ONLY']
|
feature_defines += ['-DHAVE_FFTW3', '-DFFTW_DOUBLE_ONLY']
|
||||||
pkgconfig_requirements += fftw3_dep
|
|
||||||
|
|
||||||
elif fft == 'vdsp'
|
elif fft == 'vdsp'
|
||||||
message('For FFT: using vDSP')
|
message('For FFT: using vDSP')
|
||||||
@@ -162,12 +177,16 @@ endif # fft
|
|||||||
if resampler == 'libsamplerate'
|
if resampler == 'libsamplerate'
|
||||||
if samplerate_dep.found()
|
if samplerate_dep.found()
|
||||||
message('For resampler: using libsamplerate')
|
message('For resampler: using libsamplerate')
|
||||||
|
pkgconfig_requirements += samplerate_dep
|
||||||
else
|
else
|
||||||
error('For resampler: libsamplerate selected, but dependency not found')
|
samplerate_dep = cpp.find_library('samplerate',
|
||||||
|
dirs: get_option('extra_lib_dirs'),
|
||||||
|
has_headers: ['samplerate.h'],
|
||||||
|
header_args: extra_include_args,
|
||||||
|
required: true)
|
||||||
endif
|
endif
|
||||||
feature_dependencies += samplerate_dep
|
feature_dependencies += samplerate_dep
|
||||||
feature_defines += ['-DHAVE_LIBSAMPLERATE']
|
feature_defines += ['-DHAVE_LIBSAMPLERATE']
|
||||||
pkgconfig_requirements += samplerate_dep
|
|
||||||
|
|
||||||
elif resampler == 'speex'
|
elif resampler == 'speex'
|
||||||
message('For resampler: using Speex')
|
message('For resampler: using Speex')
|
||||||
@@ -222,6 +241,31 @@ if ipp_needed
|
|||||||
endif
|
endif
|
||||||
endif # ipp_needed
|
endif # ipp_needed
|
||||||
|
|
||||||
|
if not vamp_dep.found()
|
||||||
|
vamp_dep = cpp.find_library('VampPluginSDK',
|
||||||
|
dirs: get_option('extra_lib_dirs'),
|
||||||
|
has_headers: ['vamp-sdk.h'],
|
||||||
|
header_args: extra_include_args,
|
||||||
|
required: false)
|
||||||
|
if not vamp_dep.found()
|
||||||
|
vamp_dep = cpp.find_library('vamp-sdk',
|
||||||
|
dirs: get_option('extra_lib_dirs'),
|
||||||
|
has_headers: ['vamp-sdk.h'],
|
||||||
|
header_args: extra_include_args,
|
||||||
|
required: false)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
have_vamp = vamp_dep.found()
|
||||||
|
|
||||||
|
if not sndfile_dep.found()
|
||||||
|
sndfile_dep = cpp.find_library('sndfile',
|
||||||
|
dirs: get_option('extra_lib_dirs'),
|
||||||
|
has_headers: ['sndfile.h'],
|
||||||
|
header_args: extra_include_args,
|
||||||
|
required: false)
|
||||||
|
endif
|
||||||
|
have_sndfile = sndfile_dep.found()
|
||||||
|
|
||||||
|
|
||||||
# General platform and compiler expectations
|
# General platform and compiler expectations
|
||||||
|
|
||||||
@@ -257,13 +301,9 @@ if system == 'darwin'
|
|||||||
|
|
||||||
elif system == 'windows'
|
elif system == 'windows'
|
||||||
if cpp.get_id() == 'msvc'
|
if cpp.get_id() == 'msvc'
|
||||||
feature_defines += ['-DWIN32', '-D__MSVC__', '-DNOMINMAX', '-D_USE_MATH_DEFINES']
|
feature_defines += ['-DWIN32', '-D__MSVC__', '-DNOMINMAX', '-D_USE_MATH_DEFINES', '-DGETOPT_API=']
|
||||||
ladspa_symbol_args += ['-EXPORT:ladspa_descriptor']
|
ladspa_symbol_args += ['-EXPORT:ladspa_descriptor']
|
||||||
vamp_symbol_args += ['-EXPORT:vampGetPluginDescriptor']
|
vamp_symbol_args += ['-EXPORT:vampGetPluginDescriptor']
|
||||||
# Meson likes libxxx.a even on Windows, and so might we for a
|
|
||||||
# new library, but not here
|
|
||||||
platform_static_name_prefix = ''
|
|
||||||
platform_static_name_suffix = 'lib'
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
else # system not darwin or windows
|
else # system not darwin or windows
|
||||||
@@ -277,29 +317,41 @@ else # system not darwin or windows
|
|||||||
endif # system
|
endif # system
|
||||||
|
|
||||||
|
|
||||||
|
general_include_dirs += get_option('extra_include_dirs')
|
||||||
|
general_compile_args = [ arch_flags, feature_defines ]
|
||||||
|
general_dependencies = [ feature_dependencies, thread_dep ]
|
||||||
|
|
||||||
|
if system == 'windows'
|
||||||
|
if get_option('no_shared')
|
||||||
|
rubberband_static_name = 'rubberband'
|
||||||
|
else
|
||||||
|
rubberband_static_name = 'rubberband-static'
|
||||||
|
endif
|
||||||
|
rubberband_dynamic_name = 'rubberband'
|
||||||
|
rubberband_program_name = 'rubberband-program'
|
||||||
|
# Meson likes libxxx.a even on Windows, and so might we for a
|
||||||
|
# new library, but not here
|
||||||
|
platform_static_name_prefix = ''
|
||||||
|
platform_static_name_suffix = 'lib'
|
||||||
|
else
|
||||||
|
rubberband_static_name = 'rubberband'
|
||||||
|
rubberband_dynamic_name = 'rubberband'
|
||||||
|
rubberband_program_name = 'rubberband'
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
# And the build targets: Static and dynamic libraries, command-line
|
# And the build targets: Static and dynamic libraries, command-line
|
||||||
# utility, LADSPA plugin, Vamp plugin
|
# utility, LADSPA plugin, Vamp plugin
|
||||||
|
|
||||||
message('Will build Rubber Band Library static library')
|
message('Will build Rubber Band Library static library')
|
||||||
rubberband_static = static_library(
|
rubberband_static = static_library(
|
||||||
'rubberband',
|
rubberband_static_name,
|
||||||
library_sources,
|
library_sources,
|
||||||
feature_sources,
|
feature_sources,
|
||||||
include_directories: [
|
include_directories: general_include_dirs,
|
||||||
general_include_dirs,
|
cpp_args: general_compile_args,
|
||||||
],
|
c_args: general_compile_args,
|
||||||
cpp_args: [
|
dependencies: general_dependencies,
|
||||||
arch_flags,
|
|
||||||
feature_defines,
|
|
||||||
],
|
|
||||||
c_args: [
|
|
||||||
arch_flags,
|
|
||||||
feature_defines,
|
|
||||||
],
|
|
||||||
dependencies: [
|
|
||||||
feature_dependencies,
|
|
||||||
thread_dep,
|
|
||||||
],
|
|
||||||
name_prefix: platform_static_name_prefix,
|
name_prefix: platform_static_name_prefix,
|
||||||
name_suffix: platform_static_name_suffix,
|
name_suffix: platform_static_name_suffix,
|
||||||
pic: true,
|
pic: true,
|
||||||
@@ -310,38 +362,31 @@ rubberband_static_dep = declare_dependency(
|
|||||||
link_with: rubberband_static,
|
link_with: rubberband_static,
|
||||||
)
|
)
|
||||||
|
|
||||||
message('Will build Rubber Band Library dynamic library')
|
if not get_option('no_shared')
|
||||||
rubberband_dynamic = shared_library(
|
message('Will build Rubber Band Library dynamic library')
|
||||||
'rubberband',
|
rubberband_dynamic = shared_library(
|
||||||
objects: rubberband_static.extract_all_objects(),
|
rubberband_dynamic_name,
|
||||||
link_args: [
|
objects: rubberband_static.extract_all_objects(),
|
||||||
arch_flags,
|
link_args: [
|
||||||
feature_libraries,
|
arch_flags,
|
||||||
],
|
feature_libraries,
|
||||||
dependencies: [
|
],
|
||||||
feature_dependencies,
|
dependencies: general_dependencies,
|
||||||
thread_dep,
|
version: rubberband_dynamic_library_version,
|
||||||
],
|
install: true,
|
||||||
version: rubberband_dynamic_library_version,
|
)
|
||||||
install: true,
|
else
|
||||||
)
|
message('Not building Rubber Band Library dynamic library: no_shared option set')
|
||||||
|
endif
|
||||||
|
|
||||||
if have_ladspa
|
if have_ladspa
|
||||||
message('Will build LADSPA plugin')
|
message('Will build LADSPA plugin')
|
||||||
rubberband_ladspa = shared_library(
|
rubberband_ladspa = shared_library(
|
||||||
'ladspa-rubberband',
|
'ladspa-rubberband',
|
||||||
ladspa_sources,
|
ladspa_sources,
|
||||||
include_directories: [
|
include_directories: general_include_dirs,
|
||||||
general_include_dirs,
|
cpp_args: general_compile_args,
|
||||||
],
|
c_args: general_compile_args,
|
||||||
cpp_args: [
|
|
||||||
arch_flags,
|
|
||||||
feature_defines,
|
|
||||||
],
|
|
||||||
c_args: [
|
|
||||||
arch_flags,
|
|
||||||
feature_defines,
|
|
||||||
],
|
|
||||||
link_args: [
|
link_args: [
|
||||||
arch_flags,
|
arch_flags,
|
||||||
feature_libraries,
|
feature_libraries,
|
||||||
@@ -349,8 +394,7 @@ if have_ladspa
|
|||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
rubberband_static_dep,
|
rubberband_static_dep,
|
||||||
feature_dependencies,
|
general_dependencies,
|
||||||
thread_dep,
|
|
||||||
],
|
],
|
||||||
name_prefix: '',
|
name_prefix: '',
|
||||||
install: true,
|
install: true,
|
||||||
@@ -368,22 +412,14 @@ else
|
|||||||
message('Not building LADSPA plugin: ladspa.h header not found')
|
message('Not building LADSPA plugin: ladspa.h header not found')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if vamp_dep.found()
|
if have_vamp
|
||||||
message('Will build Vamp plugin')
|
message('Will build Vamp plugin')
|
||||||
rubberband_vamp = shared_library(
|
rubberband_vamp = shared_library(
|
||||||
'vamp-rubberband',
|
'vamp-rubberband',
|
||||||
vamp_sources,
|
vamp_sources,
|
||||||
include_directories: [
|
include_directories: general_include_dirs,
|
||||||
general_include_dirs,
|
cpp_args: general_compile_args,
|
||||||
],
|
c_args: general_compile_args,
|
||||||
cpp_args: [
|
|
||||||
arch_flags,
|
|
||||||
feature_defines,
|
|
||||||
],
|
|
||||||
c_args: [
|
|
||||||
arch_flags,
|
|
||||||
feature_defines,
|
|
||||||
],
|
|
||||||
link_args: [
|
link_args: [
|
||||||
arch_flags,
|
arch_flags,
|
||||||
feature_libraries,
|
feature_libraries,
|
||||||
@@ -391,9 +427,8 @@ if vamp_dep.found()
|
|||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
rubberband_static_dep,
|
rubberband_static_dep,
|
||||||
feature_dependencies,
|
general_dependencies,
|
||||||
vamp_dep,
|
vamp_dep,
|
||||||
thread_dep,
|
|
||||||
],
|
],
|
||||||
name_prefix: '',
|
name_prefix: '',
|
||||||
install: true,
|
install: true,
|
||||||
@@ -407,31 +442,22 @@ else
|
|||||||
message('Not building Vamp plugin: Vamp dependency not found')
|
message('Not building Vamp plugin: Vamp dependency not found')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if sndfile_dep.found()
|
if have_sndfile
|
||||||
message('Will build command-line utility')
|
message('Will build command-line utility')
|
||||||
rubberband_program = executable(
|
rubberband_program = executable(
|
||||||
'rubberband',
|
rubberband_program_name,
|
||||||
program_sources,
|
program_sources,
|
||||||
include_directories: [
|
include_directories: general_include_dirs,
|
||||||
general_include_dirs,
|
cpp_args: general_compile_args,
|
||||||
],
|
c_args: general_compile_args,
|
||||||
cpp_args: [
|
|
||||||
arch_flags,
|
|
||||||
feature_defines,
|
|
||||||
],
|
|
||||||
c_args: [
|
|
||||||
arch_flags,
|
|
||||||
feature_defines,
|
|
||||||
],
|
|
||||||
link_args: [
|
link_args: [
|
||||||
arch_flags,
|
arch_flags,
|
||||||
feature_libraries,
|
feature_libraries,
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
rubberband_static_dep,
|
rubberband_static_dep,
|
||||||
feature_dependencies,
|
general_dependencies,
|
||||||
sndfile_dep,
|
sndfile_dep,
|
||||||
thread_dep,
|
|
||||||
],
|
],
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16,3 +16,18 @@ option('ipp_path',
|
|||||||
value: '',
|
value: '',
|
||||||
description: 'Path to Intel IPP libraries, if selected for any of the other options.')
|
description: 'Path to Intel IPP libraries, if selected for any of the other options.')
|
||||||
|
|
||||||
|
option('extra_include_dirs',
|
||||||
|
type: 'array',
|
||||||
|
value: [],
|
||||||
|
description: 'Additional local header directories to search for dependencies.')
|
||||||
|
|
||||||
|
option('extra_lib_dirs',
|
||||||
|
type: 'array',
|
||||||
|
value: [],
|
||||||
|
description: 'Additional local library directories to search for dependencies.')
|
||||||
|
|
||||||
|
option('no_shared',
|
||||||
|
type: 'boolean',
|
||||||
|
value: 'false',
|
||||||
|
description: 'Do not build shared libraries. On Windows this will also ensure that the static library is called simply rubberband.lib, not rubberband-static.lib as it is in the default build.')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user