project (webrtc)

# Rely on C++ 11
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set (WEBRTC_SOURCES
    ilbcfix/xcorr_coef.c
    ilbcfix/window32_w32.c
    ilbcfix/vq4.c
    ilbcfix/vq3.c
    ilbcfix/unpack_bits.c
    ilbcfix/swap_bytes.c
    ilbcfix/state_search.c
    ilbcfix/state_construct.c
    ilbcfix/split_vq.c
    ilbcfix/sort_sq.c
    ilbcfix/smooth.c
    ilbcfix/smooth_out_data.c
    ilbcfix/simple_lsf_quant.c
    ilbcfix/simple_lsf_dequant.c
    ilbcfix/simple_lpc_analysis.c
    ilbcfix/simple_interpolate_lsf.c
    ilbcfix/refiner.c
    ilbcfix/poly_to_lsp.c
    ilbcfix/poly_to_lsf.c
    ilbcfix/pack_bits.c
    ilbcfix/nearest_neighbor.c
    ilbcfix/my_corr.c
    ilbcfix/lsp_to_lsf.c
    ilbcfix/lsf_to_poly.c
    ilbcfix/lsf_to_lsp.c
    ilbcfix/lsf_interpolate_to_poly_enc.c
    ilbcfix/lsf_interpolate_to_poly_dec.c
    ilbcfix/lsf_check.c
    ilbcfix/lpc_encode.c
    ilbcfix/interpolate.c
    ilbcfix/interpolate_samples.c
    ilbcfix/init_encode.c
    ilbcfix/init_decode.c
    ilbcfix/index_conv_enc.c
    ilbcfix/index_conv_dec.c
    ilbcfix/ilbc.c
    ilbcfix/ilbc_encode.c
    ilbcfix/ilbc_decode.c
    ilbcfix/ilbc_constants.c
    ilbcfix/ilbc_cb_search.c
    ilbcfix/hp_output.c
    ilbcfix/hp_input.c
    ilbcfix/get_sync_seq.c
    ilbcfix/get_lsp_poly.c
    ilbcfix/get_cd_vec.c
    ilbcfix/gain_quant.c
    ilbcfix/gain_dequant.c
    ilbcfix/frame_classify.c
    ilbcfix/filtered_cb_vecs.c
    ilbcfix/enhancer.c
    ilbcfix/enhancer_interface.c
    ilbcfix/enh_upsample.c
    ilbcfix/energy_inverse.c
    ilbcfix/do_plc.c
    ilbcfix/decoder_interpolate_lsf.c
    ilbcfix/decode_residual.c
    ilbcfix/create_augmented_vec.c
    ilbcfix/comp_corr.c
    ilbcfix/chebyshev.c
    ilbcfix/cb_update_best_index.c
    ilbcfix/cb_search_core.c
    ilbcfix/cb_mem_energy.c
    ilbcfix/cb_mem_energy_calc.c
    ilbcfix/cb_mem_energy_augmentation.c
    ilbcfix/cb_construct.c
    ilbcfix/bw_expand.c
    ilbcfix/augmented_cb_corr.c
    ilbcfix/abs_quant.c
    ilbcfix/abs_quant_loop.c
    cng/webrtc_cng.c
    cng/cng_helpfuns.c
    aecm/echo_control_mobile.c
    aecm/aecm_core.c
    aec/resampler.c
    aec/echo_cancellation.c
    aec/aec_core.c
    aec/aec_core_sse2.c
    aec/aec_core_rdft.c
    vad/webrtc_vad.c
    vad/vad_sp.c
    vad/vad_gmm.c
    vad/vad_filterbank.c
    vad/vad_core.c
    vad/vad_const.c
    isac/transform.c
    isac/spectrum_ar_model_tables.c
    isac/pitch_lag_tables.c
    isac/pitch_gain_tables.c
    isac/pitch_filter.c
    isac/pitch_estimator.c
    isac/lpc_tables.c
    isac/lpc_masking_model.c
    isac/lattice.c
    isac/isacfix.c
    isac/isac_filters.c
    isac/isac_decode.c
    isac/initialize.c
    isac/filterbanks.c
    isac/filterbank_tables.c
    isac/fft.c
    isac/entropy_coding.c
    isac/encode.c
    isac/decode_plc.c
    isac/decode_bwe.c
    isac/bandwidth_estimator.c
    isac/arith_routines.c
    isac/arith_routines_logist.c
    isac/arith_routines_hist.c
    g711/g711.c
    g711/g711_interface.c
    ns/nsx_core.c
    ns/ns_core.c
    ns/noise_suppression.c
    ns/noise_suppression_x.c
    signal_processing_library/energy.c
    signal_processing_library/downsample_fast.c
    signal_processing_library/dot_product_with_scale.c
    signal_processing_library/division_operations.c
    signal_processing_library/cross_correlation.c
    signal_processing_library/cos_table.c
    signal_processing_library/copy_set_operations.c
    signal_processing_library/complex_ifft.c
    signal_processing_library/complex_fft.c
    signal_processing_library/complex_bit_reverse.c
    signal_processing_library/auto_correlation.c
    signal_processing_library/auto_corr_to_refl_coef.c
    signal_processing_library/add_sat_w32.c
    signal_processing_library/add_sat_w16.c
    signal_processing_library/webrtc_fft_t_rad.c
    signal_processing_library/webrtc_fft_t_1024_8.c
    signal_processing_library/vector_scaling_operations.c
    signal_processing_library/sub_sat_w32.c
    signal_processing_library/sub_sat_w16.c
    signal_processing_library/sqrt_of_one_minus_x_squared.c
    signal_processing_library/splitting_filter.c
    signal_processing_library/spl_version.c
    signal_processing_library/spl_sqrt.c
    signal_processing_library/sin_table.c
    signal_processing_library/sin_table_1024.c
    signal_processing_library/resample.c
    signal_processing_library/resample_fractional.c
    signal_processing_library/resample_by_2.c
    signal_processing_library/resample_by_2_internal.c
    signal_processing_library/resample_48khz.c
    signal_processing_library/refl_coef_to_lpc.c
    signal_processing_library/randomization_functions.c
    signal_processing_library/randn_table.c
    signal_processing_library/norm_w32.c
    signal_processing_library/norm_w16.c
    signal_processing_library/norm_u32.c
    signal_processing_library/min_max_operations.c
    signal_processing_library/lpc_to_refl_coef.c
    signal_processing_library/levinson_durbin.c
    signal_processing_library/ilbc_specific_functions.c
    signal_processing_library/hanning_table.c
    signal_processing_library/get_size_in_bits.c
    signal_processing_library/get_scaling_square.c
    signal_processing_library/get_hanning_window.c
    signal_processing_library/filter_ma_fast_q12.c
    signal_processing_library/filter_ar.c
    signal_processing_library/filter_ar_fast_q12.c
    utility/ring_buffer.c
    utility/fft4g.c
)

add_library(webrtc ${WEBRTC_SOURCES})

target_include_directories(webrtc PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/signal_processing_library
    ${CMAKE_CURRENT_SOURCE_DIR}/utility
    )

# set_property(TARGET webrtc PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
