[aubio] Use CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS

This commit is contained in:
Robert Schumacher 2017-06-20 03:16:23 -07:00
parent ced194257d
commit b7efd0e07d
4 changed files with 10 additions and 518 deletions

View File

@ -17,6 +17,8 @@ add_definitions(
-DHAVE_SWRESAMPLE=1
)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
find_path(LIBSNDFILE_H sndfile.h)
find_library(LIBSNDFILE_LIB NAMES libsndfile-1 libsndfile)
find_library(AVCODEC_LIB avcodec)
@ -29,7 +31,7 @@ find_library(SWRESAMPLE_LIB swresample)
include_directories(src ${LIBSNDFILE_H})
link_libraries(${LIBSNDFILE_LIB} ${AVCODEC_LIB} ${AVUTIL_LIB} ${AVDEVICE_LIB} ${AVFILTER_LIB} ${AVFORMAT_LIB} ${SWRESAMPLE_LIB} ws2_32.lib)
file(GLOB_RECURSE SOURCES src/*.c aubio-5.def)
file(GLOB_RECURSE SOURCES src/*.c)
set_source_files_properties(src/io/sink_wavwrite.c PROPERTIES COMPILE_FLAGS /FIWinsock2.h)
add_library(aubio ${SOURCES})

View File

@ -1,442 +0,0 @@
EXPORTS
aubio_autocorr
aubio_beattracking_checkstate
aubio_beattracking_do
aubio_beattracking_get_bpm
aubio_beattracking_get_confidence
aubio_beattracking_get_period
aubio_beattracking_get_period_s
aubio_bintofreq
aubio_bintomidi
aubio_cleanup
aubio_db_spl
aubio_default_log
aubio_fft_do
aubio_fft_do_complex
aubio_fft_get_imag
aubio_fft_get_norm
aubio_fft_get_phas
aubio_fft_get_real
aubio_fft_get_realimag
aubio_fft_get_spectrum
aubio_fft_rdo
aubio_fft_rdo_complex
aubio_filter_do
aubio_filter_do_filtfilt
aubio_filter_do_outplace
aubio_filter_do_reset
aubio_filter_get_feedback
aubio_filter_get_feedforward
aubio_filter_get_order
aubio_filter_get_samplerate
aubio_filter_set_a_weighting
aubio_filter_set_biquad
aubio_filter_set_c_weighting
aubio_filter_set_samplerate
aubio_filterbank_do
aubio_filterbank_get_coeffs
aubio_filterbank_set_coeffs
aubio_filterbank_set_mel_coeffs_slaney
aubio_filterbank_set_triangle_bands
aubio_freqtobin
aubio_freqtomidi
aubio_hist_do
aubio_hist_do_notnull
aubio_hist_dyn_notnull
aubio_hist_mean
aubio_hist_weight
aubio_io_validate_channels
aubio_io_validate_samplerate
aubio_is_power_of_two
aubio_level_detection
aubio_level_lin
aubio_log
aubio_log_reset
aubio_log_set_function
aubio_log_set_level_function
aubio_mfcc_do
aubio_miditobin
aubio_miditofreq
aubio_next_power_of_two
aubio_notes_do
aubio_notes_get_minioi_ms
aubio_notes_get_silence
aubio_notes_set_minioi_ms
aubio_notes_set_silence
aubio_onset_do
aubio_onset_get_awhitening
aubio_onset_get_compression
aubio_onset_get_delay
aubio_onset_get_delay_ms
aubio_onset_get_delay_s
aubio_onset_get_descriptor
aubio_onset_get_last
aubio_onset_get_last_ms
aubio_onset_get_last_s
aubio_onset_get_minioi
aubio_onset_get_minioi_ms
aubio_onset_get_minioi_s
aubio_onset_get_silence
aubio_onset_get_threshold
aubio_onset_get_thresholded_descriptor
aubio_onset_reset
aubio_onset_set_awhitening
aubio_onset_set_compression
aubio_onset_set_default_parameters
aubio_onset_set_delay
aubio_onset_set_delay_ms
aubio_onset_set_delay_s
aubio_onset_set_minioi
aubio_onset_set_minioi_ms
aubio_onset_set_minioi_s
aubio_onset_set_silence
aubio_onset_set_threshold
aubio_ooura_cdft
aubio_ooura_ddct
aubio_ooura_ddst
aubio_ooura_dfct
aubio_ooura_dfst
aubio_ooura_rdft
aubio_parameter_get_current_value
aubio_parameter_get_max_value
aubio_parameter_get_min_value
aubio_parameter_get_next_value
aubio_parameter_get_steps
aubio_parameter_set_current_value
aubio_parameter_set_max_value
aubio_parameter_set_min_value
aubio_parameter_set_steps
aubio_parameter_set_target_value
aubio_peakpicker_do
aubio_peakpicker_get_threshold
aubio_peakpicker_get_thresholded_input
aubio_peakpicker_get_thresholdfn
aubio_peakpicker_set_threshold
aubio_peakpicker_set_thresholdfn
aubio_pitch_cands
aubio_pitch_do
aubio_pitch_get_confidence
aubio_pitch_get_silence
aubio_pitch_get_tolerance
aubio_pitch_set_silence
aubio_pitch_set_tolerance
aubio_pitch_set_unit
aubio_pitch_slideblock
aubio_pitchfcomb_do
aubio_pitchmcomb_combdet
aubio_pitchmcomb_do
aubio_pitchmcomb_get_root_peak
aubio_pitchmcomb_quadpick
aubio_pitchmcomb_sort_cand_ene
aubio_pitchmcomb_sort_cand_freq
aubio_pitchmcomb_sort_peak
aubio_pitchmcomb_spectral_pp
aubio_pitchschmitt_do
aubio_pitchspecacf_do
aubio_pitchspecacf_get_confidence
aubio_pitchspecacf_get_tolerance
aubio_pitchspecacf_set_tolerance
aubio_pitchyin_diff
aubio_pitchyin_do
aubio_pitchyin_get_confidence
aubio_pitchyin_get_tolerance
aubio_pitchyin_getcum
aubio_pitchyin_getpitch
aubio_pitchyin_set_tolerance
aubio_pitchyinfft_do
aubio_pitchyinfft_get_confidence
aubio_pitchyinfft_get_tolerance
aubio_pitchyinfft_set_tolerance
aubio_pvoc_do
aubio_pvoc_rdo
aubio_quadfrac
aubio_resampler_do
aubio_sampler_do
aubio_sampler_do_multi
aubio_sampler_get_playing
aubio_sampler_load
aubio_sampler_play
aubio_sampler_set_playing
aubio_sampler_stop
aubio_scale_do
aubio_scale_set_limits
aubio_schmittS16LE
aubio_silence_detection
aubio_sink_close
aubio_sink_do
aubio_sink_do_multi
aubio_sink_get_channels
aubio_sink_get_samplerate
aubio_sink_preset_channels
aubio_sink_preset_samplerate
aubio_sink_sndfile_close
aubio_sink_sndfile_do
aubio_sink_sndfile_do_multi
aubio_sink_sndfile_get_channels
aubio_sink_sndfile_get_samplerate
aubio_sink_sndfile_open
aubio_sink_sndfile_preset_channels
aubio_sink_sndfile_preset_samplerate
aubio_sink_wavwrite_close
aubio_sink_wavwrite_do
aubio_sink_wavwrite_do_multi
aubio_sink_wavwrite_get_channels
aubio_sink_wavwrite_get_samplerate
aubio_sink_wavwrite_open
aubio_sink_wavwrite_preset_channels
aubio_sink_wavwrite_preset_samplerate
aubio_source_avcodec_close
aubio_source_avcodec_do
aubio_source_avcodec_do_multi
aubio_source_avcodec_get_channels
aubio_source_avcodec_get_duration
aubio_source_avcodec_get_samplerate
aubio_source_avcodec_has_network_url
aubio_source_avcodec_readframe
aubio_source_avcodec_reset_resampler
aubio_source_avcodec_seek
aubio_source_close
aubio_source_do
aubio_source_do_multi
aubio_source_get_channels
aubio_source_get_duration
aubio_source_get_samplerate
aubio_source_seek
aubio_source_sndfile_close
aubio_source_sndfile_do
aubio_source_sndfile_do_multi
aubio_source_sndfile_get_channels
aubio_source_sndfile_get_duration
aubio_source_sndfile_get_samplerate
aubio_source_sndfile_seek
aubio_source_wavread_close
aubio_source_wavread_do
aubio_source_wavread_do_multi
aubio_source_wavread_get_channels
aubio_source_wavread_get_duration
aubio_source_wavread_get_samplerate
aubio_source_wavread_readframe
aubio_source_wavread_seek
aubio_specdesc_centroid
aubio_specdesc_complex
aubio_specdesc_decrease
aubio_specdesc_do
aubio_specdesc_energy
aubio_specdesc_hfc
aubio_specdesc_kl
aubio_specdesc_kurtosis
aubio_specdesc_mkl
aubio_specdesc_phase
aubio_specdesc_rolloff
aubio_specdesc_skewness
aubio_specdesc_slope
aubio_specdesc_specdiff
aubio_specdesc_specflux
aubio_specdesc_spread
aubio_specdesc_wphase
aubio_spectral_whitening_do
aubio_spectral_whitening_get_floor
aubio_spectral_whitening_get_relax_time
aubio_spectral_whitening_reset
aubio_spectral_whitening_set_floor
aubio_spectral_whitening_set_relax_time
aubio_tempo_do
aubio_tempo_get_bpm
aubio_tempo_get_confidence
aubio_tempo_get_delay
aubio_tempo_get_delay_ms
aubio_tempo_get_delay_s
aubio_tempo_get_last
aubio_tempo_get_last_ms
aubio_tempo_get_last_s
aubio_tempo_get_last_tatum
aubio_tempo_get_period
aubio_tempo_get_period_s
aubio_tempo_get_silence
aubio_tempo_get_threshold
aubio_tempo_set_delay
aubio_tempo_set_delay_ms
aubio_tempo_set_delay_s
aubio_tempo_set_silence
aubio_tempo_set_tatum_signature
aubio_tempo_set_threshold
aubio_tempo_was_tatum
aubio_tss_do
aubio_tss_set_alpha
aubio_tss_set_beta
aubio_tss_set_threshold
aubio_unwrap2pi
aubio_wavetable_do
aubio_wavetable_do_multi
aubio_wavetable_get_amp
aubio_wavetable_get_freq
aubio_wavetable_get_playing
aubio_wavetable_play
aubio_wavetable_set_amp
aubio_wavetable_set_freq
aubio_wavetable_set_playing
aubio_wavetable_stop
aubio_zero_crossing_rate
cvec_centroid
cvec_copy
cvec_logmag
cvec_mean
cvec_moment
cvec_norm_get_data
cvec_norm_get_sample
cvec_norm_ones
cvec_norm_set_all
cvec_norm_set_sample
cvec_norm_zeros
cvec_phas_get_data
cvec_phas_get_sample
cvec_phas_ones
cvec_phas_set_all
cvec_phas_set_sample
cvec_phas_zeros
cvec_print
cvec_sum
cvec_zeros
del_aubio_beattracking
del_aubio_fft
del_aubio_filter
del_aubio_filterbank
del_aubio_hist
del_aubio_mfcc
del_aubio_notes
del_aubio_onset
del_aubio_parameter
del_aubio_peakpicker
del_aubio_pitch
del_aubio_pitchfcomb
del_aubio_pitchmcomb
del_aubio_pitchschmitt
del_aubio_pitchspecacf
del_aubio_pitchyin
del_aubio_pitchyinfft
del_aubio_pvoc
del_aubio_resampler
del_aubio_sampler
del_aubio_scale
del_aubio_sink
del_aubio_sink_sndfile
del_aubio_sink_wavwrite
del_aubio_source
del_aubio_source_avcodec
del_aubio_source_sndfile
del_aubio_source_wavread
del_aubio_specdesc
del_aubio_spectral_whitening
del_aubio_tempo
del_aubio_tss
del_aubio_wavetable
del_cvec
del_fmat
del_fvec
del_lvec
fmat_copy
fmat_get_channel
fmat_get_channel_data
fmat_get_data
fmat_get_sample
fmat_ones
fmat_print
fmat_rev
fmat_set
fmat_set_sample
fmat_vecmul
fmat_weight
fmat_zeros
fvec_abs
fvec_adapt_thres
fvec_add
fvec_alpha_norm
fvec_alpha_normalise
fvec_ceil
fvec_clamp
fvec_copy
fvec_cos
fvec_exp
fvec_floor
fvec_get_data
fvec_get_sample
fvec_gettimesig
fvec_ishift
fvec_local_hfc
fvec_log
fvec_log10
fvec_max
fvec_max_elem
fvec_mean
fvec_median
fvec_min
fvec_min_elem
fvec_min_removal
fvec_moving_thres
fvec_ones
fvec_peakpick
fvec_pow
fvec_print
fvec_push
fvec_quadratic_peak_mag
fvec_quadratic_peak_pos
fvec_rev
fvec_round
fvec_set_all
fvec_set_sample
fvec_set_window
fvec_shift
fvec_sin
fvec_sqrt
fvec_sum
fvec_weight
fvec_weighted_copy
fvec_zeros
lvec_get_data
lvec_get_sample
lvec_ones
lvec_print
lvec_set_all
lvec_set_sample
lvec_zeros
new_aubio_beattracking
new_aubio_fft
new_aubio_filter
new_aubio_filter_a_weighting
new_aubio_filter_biquad
new_aubio_filter_c_weighting
new_aubio_filterbank
new_aubio_hist
new_aubio_mfcc
new_aubio_notes
new_aubio_onset
new_aubio_parameter
new_aubio_peakpicker
new_aubio_pitch
new_aubio_pitchfcomb
new_aubio_pitchmcomb
new_aubio_pitchschmitt
new_aubio_pitchspecacf
new_aubio_pitchyin
new_aubio_pitchyinfft
new_aubio_pvoc
new_aubio_resampler
new_aubio_sampler
new_aubio_scale
new_aubio_sink
new_aubio_sink_sndfile
new_aubio_sink_wavwrite
new_aubio_source
new_aubio_source_avcodec
new_aubio_source_sndfile
new_aubio_source_wavread
new_aubio_specdesc
new_aubio_spectral_whitening
new_aubio_tempo
new_aubio_tss
new_aubio_wavetable
new_aubio_window
new_cvec
new_fmat
new_fvec
new_lvec

View File

@ -1,68 +0,0 @@
diff --git a/src/wscript_build b/src/wscript_build
index 0a7d72a..bf84227 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -24,7 +24,12 @@ ctx(features = 'c',
if ctx.env['DEST_OS'] in ['ios', 'iosimulator']:
build_features = ['cstlib', 'cshlib']
elif ctx.env['DEST_OS'] in ['win32', 'win64']:
- build_features = ['cstlib', 'cshlib']
+ if ctx.options.library_linkage == "static":
+ build_features = ['cstlib']
+ elif ctx.options.library_linkage == "dynamic":
+ build_features = ['cshlib']
+ else:
+ build_features = ['cstlib', 'cshlib']
elif ctx.env['DEST_OS'] in ['emscripten']:
build_features = ['cstlib']
elif '--static' in ctx.env['LDFLAGS'] or '--static' in ctx.env['LINKFLAGS']:
diff --git a/wscript b/wscript
index 6363f1e..e0d57a4 100644
--- a/wscript
+++ b/wscript
@@ -44,6 +44,16 @@ def options(ctx):
dest = 'build_type',
help = 'whether to compile with (--build-type=release) or without (--build-type=debug) '\
' compiler opimizations [default: release]')
+ ctx.add_option('--crt-linkage', action = 'store',
+ default = "dynamic",
+ choices = ('static', 'dynamic'),
+ dest = 'crt_linkage',
+ help = 'whether to compile with static CRT linkage (--crt-linkage=static) or the default dynamic (--crt-linkage=dynamic)')
+ ctx.add_option('--library-linkage', action = 'store',
+ default = "both",
+ choices = ('dynamic', 'static', 'both'),
+ dest = 'library_linkage',
+ help = 'whether to compile a dynamic (shared) (--library-linkage=dynamic) or static library (--library-linkage=static) ("both" is broken for msvc)')
add_option_enable_disable(ctx, 'fftw3f', default = False,
help_str = 'compile with fftw3f instead of ooura (recommended)',
help_disable_str = 'do not compile with fftw3f')
@@ -139,16 +149,25 @@ def configure(ctx):
else:
# enable debug symbols
ctx.env.CFLAGS += ['/Z7', '/FS']
- ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO']
+ if ctx.options.library_linkage == "dynamic":
+ ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO', '/DEF:..\\aubio-5.def']
+ else:
+ ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO']
# configure warnings
ctx.env.CFLAGS += ['/W4', '/D_CRT_SECURE_NO_WARNINGS']
# set optimization level and runtime libs
if (ctx.options.build_type == "release"):
ctx.env.CFLAGS += ['/Ox']
- ctx.env.CFLAGS += ['/MD']
+ if (ctx.options.crt_linkage == "static"):
+ ctx.env.CFLAGS += ['/MT']
+ else:
+ ctx.env.CFLAGS += ['/MD']
else:
assert(ctx.options.build_type == "debug")
- ctx.env.CFLAGS += ['/MDd']
+ if (ctx.options.crt_linkage == "static"):
+ ctx.env.CFLAGS += ['/MTd']
+ else:
+ ctx.env.CFLAGS += ['/MDd']
ctx.check_cc(lib='m', uselib_store='M', mandatory=False)

View File

@ -7,7 +7,7 @@ vcpkg_download_distfile(ARCHIVE
)
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/aubio-5.def ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
@ -17,12 +17,12 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
# Handle copyright and credentials
file(COPY
${SOURCE_PATH}/COPYING
${SOURCE_PATH}/AUTHORS
${SOURCE_PATH}/ChangeLog
${SOURCE_PATH}/README.md
DESTINATION
file(COPY
${SOURCE_PATH}/COPYING
${SOURCE_PATH}/AUTHORS
${SOURCE_PATH}/ChangeLog
${SOURCE_PATH}/README.md
DESTINATION
${CURRENT_PACKAGES_DIR}/share/aubio)
vcpkg_copy_pdbs()