SET(AUDIO_PROCESSING_SRC
  "aec/aec_core.c"
  "aec/aec_core.h"
  "aec/aec_core_internal.h"
  "aec/aec_rdft.c"
  "aec/aec_rdft.h"
  "aec/aec_resampler.c"
  "aec/aec_resampler.h"
  "aec/echo_cancellation.c"
  "aec/echo_cancellation_internal.h"
  "aec/include/echo_cancellation.h"
  "aecm/aecm_core.c"
  "aecm/aecm_core.h"
  "aecm/echo_control_mobile.c"
  "aecm/include/echo_control_mobile.h"
  "agc/agc.cc"
  "agc/agc.h"
  "agc/agc_manager_direct.cc"
  "agc/agc_manager_direct.h"
  "agc/gain_map_internal.h"
  "agc/histogram.cc"
  "agc/histogram.h"
  "agc/legacy/analog_agc.c"
  "agc/legacy/analog_agc.h"
  "agc/legacy/digital_agc.c"
  "agc/legacy/digital_agc.h"
  "agc/legacy/gain_control.h"
  "agc/utility.cc"
  "agc/utility.h"
  "audio_buffer.cc"
  "audio_buffer.h"
  "audio_processing_impl.cc"
  "audio_processing_impl.h"
  "beamformer/beamformer.h"
  "beamformer/complex_matrix.h"
  "beamformer/covariance_matrix_generator.cc"
  "beamformer/covariance_matrix_generator.h"
  "beamformer/matrix.h"
  "beamformer/nonlinear_beamformer.cc"
  "beamformer/nonlinear_beamformer.h"
  "common.h"
  "echo_cancellation_impl.cc"
  "echo_cancellation_impl.h"
  "echo_control_mobile_impl.cc"
  "echo_control_mobile_impl.h"
  "gain_control_impl.cc"
  "gain_control_impl.h"
  "high_pass_filter_impl.cc"
  "high_pass_filter_impl.h"
  "include/audio_processing.h"
  "intelligibility/intelligibility_enhancer.cc"
  "intelligibility/intelligibility_enhancer.h"
  "intelligibility/intelligibility_utils.cc"
  "intelligibility/intelligibility_utils.h"
  "level_estimator_impl.cc"
  "level_estimator_impl.h"
  "logging/aec_logging.h"
  "logging/aec_logging_file_handling.cc"
  "logging/aec_logging_file_handling.h"
  "noise_suppression_impl.cc"
  "noise_suppression_impl.h"
  "processing_component.cc"
  "processing_component.h"
  "rms_level.cc"
  "rms_level.h"
  "splitting_filter.cc"
  "splitting_filter.h"
  "three_band_filter_bank.cc"
  "three_band_filter_bank.h"
  "transient/common.h"
  "transient/daubechies_8_wavelet_coeffs.h"
  "transient/dyadic_decimator.h"
  "transient/moving_moments.cc"
  "transient/moving_moments.h"
  "transient/transient_detector.cc"
  "transient/transient_detector.h"
  "transient/transient_suppressor.cc"
  "transient/transient_suppressor.h"
  "transient/wpd_node.cc"
  "transient/wpd_node.h"
  "transient/wpd_tree.cc"
  "transient/wpd_tree.h"
  "typing_detection.cc"
  "typing_detection.h"
  "utility/delay_estimator.c"
  "utility/delay_estimator.h"
  "utility/delay_estimator_internal.h"
  "utility/delay_estimator_wrapper.c"
  "utility/delay_estimator_wrapper.h"
  "vad/common.h"
  "vad/gmm.cc"
  "vad/gmm.h"
  "vad/noise_gmm_tables.h"
  "vad/pitch_based_vad.cc"
  "vad/pitch_based_vad.h"
  "vad/pitch_internal.cc"
  "vad/pitch_internal.h"
  "vad/pole_zero_filter.cc"
  "vad/pole_zero_filter.h"
  "vad/standalone_vad.cc"
  "vad/standalone_vad.h"
  "vad/vad_audio_proc.cc"
  "vad/vad_audio_proc.h"
  "vad/vad_audio_proc_internal.h"
  "vad/vad_circular_buffer.cc"
  "vad/vad_circular_buffer.h"
  "vad/voice_activity_detector.cc"
  "vad/voice_activity_detector.h"
  "vad/voice_gmm_tables.h"
  "voice_detection_impl.cc"
  "voice_detection_impl.h"
  
  "ns/include/noise_suppression_x.h"
  "ns/noise_suppression_x.c"
  "ns/nsx_core.c"
  "ns/nsx_core.h"
  "ns/nsx_defines.h"
  "aecm/aecm_core_c.c"
  "ns/nsx_core_c.c"
  )

SET(LIBS  "")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
  if(IOS)
    if(${IOS_PLATFORM} STREQUAL OS)
      message("handle for real device")
      SET(AUDIO_PROCESSING_SRC
        ${AUDIO_PROCESSING_SRC}
        "aec/aec_core_neon.c"
        "aec/aec_rdft_neon.c"
        "aecm/aecm_core_neon.c"
        "ns/nsx_core_neon.c"
        # "aec/aec_core_sse2.c"
        # "aec/aec_rdft_sse2.c"
        )
      add_definitions(-DWEBRTC_ARCH_ARM64)
      # add_definitions(-DUSE_ARM_NEON_GCC=1)
      ADD_DEFINITIONS(-DWEBRTC_DETECT_NEON)
    else()
      SET(AUDIO_PROCESSING_SRC
        ${AUDIO_PROCESSING_SRC}
        "aec/aec_core_sse2.c"
        "aec/aec_rdft_sse2.c"
        )
    endif()
  else()
    SET(AUDIO_PROCESSING_SRC
      ${AUDIO_PROCESSING_SRC}
      "aec/aec_core_sse2.c"
      "aec/aec_rdft_sse2.c"
      )
  endif()
elseif(ANDROID)
  SET(AUDIO_PROCESSING_SRC
    ${AUDIO_PROCESSING_SRC}
    "aec/aec_core_neon.c"
    "aec/aec_rdft_neon.c"
    "aecm/aecm_core_neon.c"
    "ns/nsx_core_neon.c"
    )
endif()
add_definitions(-DWEBRTC_NS_FIXED)
add_library(AudioProcessing STATIC ${AUDIO_PROCESSING_SRC})
target_link_libraries(AudioProcessing CommonAudio SystemWrapper )
