# The following variables will be defined:
#
#  WEBRTC_FOUND
#  WEBRTC_DEFINES
#  WEBRTC_INCLUDE_DIR
#  WEBRTC_LIBRARIES_INTERNAL_RELEASE
#  WEBRTC_LIBRARIES_INTERNAL_DEBUG
#  WEBRTC_LIBRARIES_INTERNAL
#  WEBRTC_LIBRARIES_EXTERNAL
#

# ============================================================================
# WebRTC root and default library directory
# ============================================================================

message("Check WebRTC library")

if (DEFINED ENV{WEBRTC_ROOT_DIR})
  set(WEBRTC_ROOT_DIR $ENV{WEBRTC_ROOT_DIR})
  message("WEBRTC_ROOT_DIR = '${WEBRTC_ROOT_DIR}' from environment variable")
else() 
  set(WEBRTC_ROOT_DIR
    ""
    CACHE PATH
    "WebRTC root directory."
    )
endif()

if (DEFINED ENV{DEPOT_TOOLS_DIR})
  set(DEPOT_TOOLS_DIR $ENV{DEPOT_TOOLS_DIR})
  message("DEPOT_TOOLS_DIR = '${DEPOT_TOOLS_DIR}' from environment variable")
else() 
  set(DEPOT_TOOLS_DIR
    ""
    CACHE PATH
    "WebRTC depot_tools directory."
    )
endif()

if ( "${WEBRTC_ROOT_DIR}" STREQUAL "")
    message(FATAL_ERROR "A WEBRTC_ROOT_DIR is requred. \n"
                        " ex) cmake .. -DWEBRTC_ROOT_DIR=/dir/webrtc-checkout/src -DDEPOT_TOOLS_DIR=/dir/depot_tools\n")
endif()

if ( "${DEPOT_TOOLS_DIR}" STREQUAL "")
    message(FATAL_ERROR "A DEPOT_TOOLS_DIR is requred.\n"
                        " ex) cmake .. -DWEBRTC_ROOT_DIR=/dir/webrtc-checkout/src -DDEPOT_TOOLS_DIR=/dir/depot_tools\n")
endif()

file(TO_CMAKE_PATH ${WEBRTC_ROOT_DIR} WEBRTC_ROOT_DIR)
file(TO_CMAKE_PATH ${DEPOT_TOOLS_DIR} DEPOT_TOOLS_DIR)

set (WEBRTC_ROOT_DIR "${WEBRTC_ROOT_DIR}/")
set (DEPOT_TOOLS_DIR "${DEPOT_TOOLS_DIR}/")

set( WEBRTC_OUT_DIR "out/Peers")
set( WEBRTC_OUT_DIR_DEBUG "out/PeersDebug")
set( WEBRTC_LIBRARY_DIR ${WEBRTC_ROOT_DIR}/${WEBRTC_OUT_DIR})
set( WEBRTC_LIBRARY_DIR_DEBUG ${WEBRTC_ROOT_DIR}${WEBRTC_OUT_DIR_DEBUG})


# ============================================================================
# Find WebRTC header directory
# ============================================================================

find_path(WEBRTC_INCLUDE_DIR
  NAMES
  	webrtc/config.h
  PATHS
  	${WEBRTC_ROOT_DIR}
  )

list(APPEND WEBRTC_INCLUDE_DIR
  "${WEBRTC_INCLUDE_DIR}"
  "${WEBRTC_INCLUDE_DIR}/webrtc"
  "${WEBRTC_INCLUDE_DIR}/webrtc/third_party/libyuv/include"
  "${WEBRTC_INCLUDE_DIR}/third_party/jsoncpp/overrides/include"
  "${WEBRTC_INCLUDE_DIR}/third_party/jsoncpp/source/include"
  "${WEBRTC_INCLUDE_DIR}/third_party/boringssl/src/include"
  )

# ============================================================================
# Find WebRTC libries
#   webrtc -> webrtc.lib or libwebrtc.a
#   libyuv yuv -> libyuv.lib or libyuv.a
#   ...
# ============================================================================

set (WEBRTC_LIBRARIES_INTERNAL_RELEASE)
set (WEBRTC_LIBRARIES_INTERNAL_DEBUG)
set (WEBRTC_LIBRARIES_INTERNAL)
set (WEBRTC_LIBRARIES_EXTERNAL)

if (MSVC)
  # from peerconnection_client.ninja, WebRTC branch-heads/60

  list(APPEND _WEBRTC_LIB_NAMES
    obj/webrtc/media/rtc_media_base.lib obj/webrtc/base/rtc_base.lib obj/webrtc/base/rtc_base_approved.lib obj/webrtc/media/rtc_media.lib obj/webrtc/modules/video_capture/video_capture_module.lib obj/webrtc/pc/libjingle_peerconnection.lib obj/webrtc/system_wrappers/field_trial_default.lib obj/webrtc/system_wrappers/metrics_default.lib obj/third_party/libyuv/libyuv_internal.lib obj/third_party/libjpeg_turbo/libjpeg.lib obj/third_party/libjpeg_turbo/simd.lib obj/third_party/libjpeg_turbo/simd_asm.lib obj/webrtc/webrtc_common.lib obj/webrtc/api/libjingle_peerconnection_api.lib obj/third_party/boringssl/boringssl.lib obj/third_party/boringssl/boringssl_asm.lib obj/webrtc/system_wrappers/system_wrappers.lib obj/webrtc/api/audio_codecs/builtin_audio_encoder_factory.lib obj/webrtc/modules/audio_coding/builtin_audio_encoder_factory_internal.lib obj/third_party/protobuf/protobuf_lite.lib obj/webrtc/modules/audio_coding/cng.lib obj/webrtc/common_audio/common_audio.lib obj/third_party/openmax_dl/dl/dl.lib obj/webrtc/common_audio/common_audio_sse2.lib obj/webrtc/modules/audio_coding/g711.lib obj/webrtc/modules/audio_coding/legacy_encoded_audio_frame.lib obj/webrtc/modules/audio_coding/pcm16b.lib obj/webrtc/modules/audio_coding/ilbc.lib obj/webrtc/modules/audio_coding/webrtc_opus.lib obj/third_party/opus/opus.lib obj/webrtc/modules/audio_coding/audio_network_adaptor.lib obj/webrtc/modules/audio_coding/ana_config_proto.lib obj/webrtc/modules/audio_coding/ana_debug_dump_proto.lib obj/webrtc/base/rtc_numerics.lib obj/webrtc/modules/audio_coding/isac.lib obj/webrtc/modules/audio_coding/isac_c.lib obj/webrtc/modules/audio_coding/isac_common.lib obj/webrtc/modules/audio_coding/g722.lib obj/webrtc/modules/audio_coding/red.lib obj/webrtc/common_video/common_video.lib obj/webrtc/base/rtc_task_queue.lib obj/webrtc/p2p/libstunprober.lib obj/webrtc/p2p/rtc_p2p.lib obj/third_party/usrsctp/usrsctp.lib obj/webrtc/modules/video_capture/video_capture_internal_impl.lib obj/third_party/winsdk_samples/winsdk_samples.lib obj/webrtc/modules/audio_processing/audioproc_debug_proto.lib obj/webrtc/api/audio_codecs/builtin_audio_decoder_factory.lib obj/webrtc/modules/audio_coding/builtin_audio_decoder_factory_internal.lib obj/webrtc/call/call.lib obj/webrtc/audio/audio.lib obj/webrtc/modules/audio_device/audio_device.lib obj/webrtc/modules/utility/utility.lib obj/webrtc/audio/utility/audio_frame_operations.lib obj/webrtc/modules/audio_coding/audio_format_conversion.lib obj/webrtc/modules/media_file/media_file.lib obj/webrtc/modules/audio_processing/audio_processing.lib obj/webrtc/modules/audio_processing/audio_processing_sse2.lib obj/webrtc/modules/bitrate_controller/bitrate_controller.lib obj/webrtc/modules/rtp_rtcp/rtp_rtcp.lib obj/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.lib obj/webrtc/modules/congestion_controller/congestion_controller.lib obj/webrtc/modules/pacing/pacing.lib obj/webrtc/voice_engine/voice_engine.lib obj/webrtc/modules/audio_coding/audio_coding.lib obj/webrtc/modules/audio_coding/neteq.lib obj/webrtc/modules/audio_coding/isac_fix.lib obj/webrtc/modules/audio_coding/rent_a_codec.lib obj/webrtc/voice_engine/audio_level.lib obj/webrtc/voice_engine/file_player.lib obj/webrtc/voice_engine/audio_coder.lib obj/webrtc/voice_engine/file_recorder.lib obj/webrtc/modules/audio_conference_mixer/audio_conference_mixer.lib obj/webrtc/logging/rtc_event_log_impl.lib obj/webrtc/logging/rtc_event_log_proto.lib obj/webrtc/video/video.lib obj/webrtc/modules/video_coding/video_coding.lib obj/webrtc/modules/video_coding/video_coding_utility.lib obj/webrtc/modules/video_coding/webrtc_h264.lib obj/webrtc/modules/video_coding/webrtc_i420.lib obj/webrtc/modules/video_coding/webrtc_vp8.lib obj/third_party/libvpx/libvpx.lib obj/third_party/libvpx/libvpx_yasm.lib obj/webrtc/modules/video_coding/webrtc_vp9.lib obj/webrtc/modules/video_processing/video_processing.lib obj/webrtc/modules/video_processing/video_processing_sse2.lib obj/webrtc/modules/audio_mixer/audio_mixer_impl.lib obj/webrtc/modules/audio_mixer/audio_frame_manipulator.lib obj/webrtc/pc/rtc_pc.lib obj/third_party/libsrtp/libsrtp.lib obj/webrtc/stats/rtc_stats.lib
  )

  list(APPEND _WEBRTC_OBJ_NAMES
    obj/webrtc/api/video_frame_api/i420_buffer.obj obj/webrtc/api/video_frame_api/video_frame.obj obj/webrtc/api/video_frame_api/video_frame_buffer.obj obj/webrtc/base/rtc_json/json.obj obj/webrtc/api/audio_codecs/audio_codecs_api/audio_decoder.obj obj/webrtc/api/audio_codecs/audio_codecs_api/audio_encoder.obj obj/webrtc/api/audio_codecs/audio_codecs_api/audio_format.obj obj/webrtc/common_audio/common_audio_c/fft4g.obj obj/webrtc/common_audio/common_audio_c/ring_buffer.obj obj/webrtc/common_audio/common_audio_c/auto_corr_to_refl_coef.obj obj/webrtc/common_audio/common_audio_c/auto_correlation.obj obj/webrtc/common_audio/common_audio_c/copy_set_operations.obj obj/webrtc/common_audio/common_audio_c/cross_correlation.obj obj/webrtc/common_audio/common_audio_c/division_operations.obj obj/webrtc/common_audio/common_audio_c/downsample_fast.obj obj/webrtc/common_audio/common_audio_c/energy.obj obj/webrtc/common_audio/common_audio_c/filter_ar.obj obj/webrtc/common_audio/common_audio_c/filter_ma_fast_q12.obj obj/webrtc/common_audio/common_audio_c/get_hanning_window.obj obj/webrtc/common_audio/common_audio_c/get_scaling_square.obj obj/webrtc/common_audio/common_audio_c/ilbc_specific_functions.obj obj/webrtc/common_audio/common_audio_c/levinson_durbin.obj obj/webrtc/common_audio/common_audio_c/lpc_to_refl_coef.obj obj/webrtc/common_audio/common_audio_c/min_max_operations.obj obj/webrtc/common_audio/common_audio_c/randomization_functions.obj obj/webrtc/common_audio/common_audio_c/real_fft.obj obj/webrtc/common_audio/common_audio_c/refl_coef_to_lpc.obj obj/webrtc/common_audio/common_audio_c/resample.obj obj/webrtc/common_audio/common_audio_c/resample_48khz.obj obj/webrtc/common_audio/common_audio_c/resample_by_2.obj obj/webrtc/common_audio/common_audio_c/resample_by_2_internal.obj obj/webrtc/common_audio/common_audio_c/resample_fractional.obj obj/webrtc/common_audio/common_audio_c/spl_init.obj obj/webrtc/common_audio/common_audio_c/spl_inl.obj obj/webrtc/common_audio/common_audio_c/spl_sqrt.obj obj/webrtc/common_audio/common_audio_c/splitting_filter.obj obj/webrtc/common_audio/common_audio_c/sqrt_of_one_minus_x_squared.obj obj/webrtc/common_audio/common_audio_c/vector_scaling_operations.obj obj/webrtc/common_audio/common_audio_c/vad_core.obj obj/webrtc/common_audio/common_audio_c/vad_filterbank.obj obj/webrtc/common_audio/common_audio_c/vad_gmm.obj obj/webrtc/common_audio/common_audio_c/vad_sp.obj obj/webrtc/common_audio/common_audio_c/webrtc_vad.obj obj/webrtc/common_audio/common_audio_c/complex_fft.obj obj/webrtc/common_audio/common_audio_c/complex_bit_reverse.obj obj/webrtc/common_audio/common_audio_c/filter_ar_fast_q12.obj obj/webrtc/common_audio/common_audio_c/spl_sqrt_floor.obj obj/webrtc/common_audio/common_audio_cc/dot_product_with_scale.obj obj/webrtc/modules/audio_coding/g711_c/g711.obj obj/webrtc/modules/audio_coding/g711_c/g711_interface.obj obj/webrtc/modules/audio_coding/pcm16b_c/pcm16b.obj obj/webrtc/modules/audio_coding/ilbc_c/abs_quant.obj obj/webrtc/modules/audio_coding/ilbc_c/abs_quant_loop.obj obj/webrtc/modules/audio_coding/ilbc_c/augmented_cb_corr.obj obj/webrtc/modules/audio_coding/ilbc_c/bw_expand.obj obj/webrtc/modules/audio_coding/ilbc_c/cb_construct.obj obj/webrtc/modules/audio_coding/ilbc_c/cb_mem_energy.obj obj/webrtc/modules/audio_coding/ilbc_c/cb_mem_energy_augmentation.obj obj/webrtc/modules/audio_coding/ilbc_c/cb_mem_energy_calc.obj obj/webrtc/modules/audio_coding/ilbc_c/cb_search.obj obj/webrtc/modules/audio_coding/ilbc_c/cb_search_core.obj obj/webrtc/modules/audio_coding/ilbc_c/cb_update_best_index.obj obj/webrtc/modules/audio_coding/ilbc_c/chebyshev.obj obj/webrtc/modules/audio_coding/ilbc_c/comp_corr.obj obj/webrtc/modules/audio_coding/ilbc_c/constants.obj obj/webrtc/modules/audio_coding/ilbc_c/create_augmented_vec.obj obj/webrtc/modules/audio_coding/ilbc_c/decode.obj obj/webrtc/modules/audio_coding/ilbc_c/decode_residual.obj obj/webrtc/modules/audio_coding/ilbc_c/decoder_interpolate_lsf.obj obj/webrtc/modules/audio_coding/ilbc_c/do_plc.obj obj/webrtc/modules/audio_coding/ilbc_c/encode.obj obj/webrtc/modules/audio_coding/ilbc_c/energy_inverse.obj obj/webrtc/modules/audio_coding/ilbc_c/enh_upsample.obj obj/webrtc/modules/audio_coding/ilbc_c/enhancer.obj obj/webrtc/modules/audio_coding/ilbc_c/enhancer_interface.obj obj/webrtc/modules/audio_coding/ilbc_c/filtered_cb_vecs.obj obj/webrtc/modules/audio_coding/ilbc_c/frame_classify.obj obj/webrtc/modules/audio_coding/ilbc_c/gain_dequant.obj obj/webrtc/modules/audio_coding/ilbc_c/gain_quant.obj obj/webrtc/modules/audio_coding/ilbc_c/get_cd_vec.obj obj/webrtc/modules/audio_coding/ilbc_c/get_lsp_poly.obj obj/webrtc/modules/audio_coding/ilbc_c/get_sync_seq.obj obj/webrtc/modules/audio_coding/ilbc_c/hp_input.obj obj/webrtc/modules/audio_coding/ilbc_c/hp_output.obj obj/webrtc/modules/audio_coding/ilbc_c/ilbc.obj obj/webrtc/modules/audio_coding/ilbc_c/index_conv_dec.obj obj/webrtc/modules/audio_coding/ilbc_c/index_conv_enc.obj obj/webrtc/modules/audio_coding/ilbc_c/init_decode.obj obj/webrtc/modules/audio_coding/ilbc_c/init_encode.obj obj/webrtc/modules/audio_coding/ilbc_c/interpolate.obj obj/webrtc/modules/audio_coding/ilbc_c/interpolate_samples.obj obj/webrtc/modules/audio_coding/ilbc_c/lpc_encode.obj obj/webrtc/modules/audio_coding/ilbc_c/lsf_check.obj obj/webrtc/modules/audio_coding/ilbc_c/lsf_interpolate_to_poly_dec.obj obj/webrtc/modules/audio_coding/ilbc_c/lsf_interpolate_to_poly_enc.obj obj/webrtc/modules/audio_coding/ilbc_c/lsf_to_lsp.obj obj/webrtc/modules/audio_coding/ilbc_c/lsf_to_poly.obj obj/webrtc/modules/audio_coding/ilbc_c/lsp_to_lsf.obj obj/webrtc/modules/audio_coding/ilbc_c/my_corr.obj obj/webrtc/modules/audio_coding/ilbc_c/nearest_neighbor.obj obj/webrtc/modules/audio_coding/ilbc_c/pack_bits.obj obj/webrtc/modules/audio_coding/ilbc_c/poly_to_lsf.obj obj/webrtc/modules/audio_coding/ilbc_c/poly_to_lsp.obj obj/webrtc/modules/audio_coding/ilbc_c/refiner.obj obj/webrtc/modules/audio_coding/ilbc_c/simple_interpolate_lsf.obj obj/webrtc/modules/audio_coding/ilbc_c/simple_lpc_analysis.obj obj/webrtc/modules/audio_coding/ilbc_c/simple_lsf_dequant.obj obj/webrtc/modules/audio_coding/ilbc_c/simple_lsf_quant.obj obj/webrtc/modules/audio_coding/ilbc_c/smooth.obj obj/webrtc/modules/audio_coding/ilbc_c/smooth_out_data.obj obj/webrtc/modules/audio_coding/ilbc_c/sort_sq.obj obj/webrtc/modules/audio_coding/ilbc_c/split_vq.obj obj/webrtc/modules/audio_coding/ilbc_c/state_construct.obj obj/webrtc/modules/audio_coding/ilbc_c/state_search.obj obj/webrtc/modules/audio_coding/ilbc_c/swap_bytes.obj obj/webrtc/modules/audio_coding/ilbc_c/unpack_bits.obj obj/webrtc/modules/audio_coding/ilbc_c/vq3.obj obj/webrtc/modules/audio_coding/ilbc_c/vq4.obj obj/webrtc/modules/audio_coding/ilbc_c/window32_w32.obj obj/webrtc/modules/audio_coding/ilbc_c/xcorr_coef.obj obj/webrtc/modules/audio_coding/webrtc_opus_c/opus_interface.obj obj/webrtc/call/call_interfaces/audio_send_stream.obj obj/webrtc/call/call_interfaces/syncable.obj obj/webrtc/modules/audio_coding/g722_c/g722_decode.obj obj/webrtc/modules/audio_coding/g722_c/g722_encode.obj obj/webrtc/modules/audio_coding/g722_c/g722_interface.obj obj/webrtc/api/ortc_api/mediadescription.obj obj/webrtc/api/ortc_api/sessiondescription.obj obj/third_party/jsoncpp/jsoncpp/json_reader.obj obj/third_party/jsoncpp/jsoncpp/json_value.obj obj/third_party/jsoncpp/jsoncpp/json_writer.obj obj/webrtc/modules/audio_processing/aec_dump/aec_dump_impl/aec_dump_impl.obj obj/webrtc/modules/audio_processing/aec_dump/aec_dump_impl/capture_stream_info.obj obj/webrtc/modules/audio_processing/aec_dump/aec_dump_impl/write_to_file_task.obj obj/webrtc/modules/audio_processing/aec_dump_interface/aec_dump.obj obj/webrtc/modules/audio_processing/audio_processing_c/analog_agc.obj obj/webrtc/modules/audio_processing/audio_processing_c/digital_agc.obj obj/webrtc/modules/audio_processing/audio_processing_c/noise_suppression.obj obj/webrtc/modules/audio_processing/audio_processing_c/ns_core.obj obj/webrtc/modules/audio_coding/isac_fix_c/arith_routines.obj obj/webrtc/modules/audio_coding/isac_fix_c/arith_routines_hist.obj obj/webrtc/modules/audio_coding/isac_fix_c/arith_routines_logist.obj obj/webrtc/modules/audio_coding/isac_fix_c/bandwidth_estimator.obj obj/webrtc/modules/audio_coding/isac_fix_c/decode.obj obj/webrtc/modules/audio_coding/isac_fix_c/decode_bwe.obj obj/webrtc/modules/audio_coding/isac_fix_c/decode_plc.obj obj/webrtc/modules/audio_coding/isac_fix_c/encode.obj obj/webrtc/modules/audio_coding/isac_fix_c/entropy_coding.obj obj/webrtc/modules/audio_coding/isac_fix_c/filterbank_tables.obj obj/webrtc/modules/audio_coding/isac_fix_c/filterbanks.obj obj/webrtc/modules/audio_coding/isac_fix_c/filters.obj obj/webrtc/modules/audio_coding/isac_fix_c/initialize.obj obj/webrtc/modules/audio_coding/isac_fix_c/isacfix.obj obj/webrtc/modules/audio_coding/isac_fix_c/lattice.obj obj/webrtc/modules/audio_coding/isac_fix_c/lattice_c.obj obj/webrtc/modules/audio_coding/isac_fix_c/lpc_masking_model.obj obj/webrtc/modules/audio_coding/isac_fix_c/lpc_tables.obj obj/webrtc/modules/audio_coding/isac_fix_c/pitch_estimator.obj obj/webrtc/modules/audio_coding/isac_fix_c/pitch_estimator_c.obj obj/webrtc/modules/audio_coding/isac_fix_c/pitch_filter.obj obj/webrtc/modules/audio_coding/isac_fix_c/pitch_filter_c.obj obj/webrtc/modules/audio_coding/isac_fix_c/pitch_gain_tables.obj obj/webrtc/modules/audio_coding/isac_fix_c/pitch_lag_tables.obj obj/webrtc/modules/audio_coding/isac_fix_c/spectrum_ar_model_tables.obj obj/webrtc/modules/audio_coding/isac_fix_c/transform.obj obj/webrtc/modules/audio_coding/isac_fix_c/transform_tables.obj obj/webrtc/modules/audio_coding/isac_fix_common/fft.obj obj/webrtc/modules/audio_coding/neteq_decoder_enum/neteq_decoder_enum.obj obj/third_party/libvpx/libvpx_intrinsics_avx/vp9_diamond_search_sad_avx.obj obj/third_party/libvpx/libvpx_intrinsics_avx2/vp9_error_avx2.obj obj/third_party/libvpx/libvpx_intrinsics_avx2/fwd_txfm_avx2.obj obj/third_party/libvpx/libvpx_intrinsics_avx2/highbd_convolve_avx2.obj obj/third_party/libvpx/libvpx_intrinsics_avx2/loopfilter_avx2.obj obj/third_party/libvpx/libvpx_intrinsics_avx2/sad4d_avx2.obj obj/third_party/libvpx/libvpx_intrinsics_avx2/sad_avx2.obj obj/third_party/libvpx/libvpx_intrinsics_avx2/variance_avx2.obj obj/third_party/libvpx/libvpx_intrinsics_avx2/variance_impl_avx2.obj obj/third_party/libvpx/libvpx_intrinsics_avx2/vpx_subpixel_8t_intrin_avx2.obj obj/third_party/libvpx/libvpx_intrinsics_mmx/idct_blk_mmx.obj obj/third_party/libvpx/libvpx_intrinsics_mmx/vp8_enc_stubs_mmx.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/idct_blk_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/denoising_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/vp8_enc_stubs_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/vp8_quantize_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_idct_intrin_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_dct_intrin_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_denoiser_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_highbd_block_error_intrin_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_quantize_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/avg_intrin_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/avg_pred_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/fwd_txfm_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct16x16_add_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct32x32_add_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct4x4_add_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct8x8_add_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_loopfilter_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_quantize_intrin_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_variance_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/inv_txfm_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/loopfilter_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/quantize_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/sum_squares_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse2/variance_sse2.obj obj/third_party/libvpx/libvpx_intrinsics_sse4_1/quantize_sse4.obj obj/third_party/libvpx/libvpx_intrinsics_sse4_1/temporal_filter_sse4.obj obj/third_party/libvpx/libvpx_intrinsics_ssse3/quantize_ssse3.obj obj/third_party/libvpx/libvpx_intrinsics_ssse3/vp9_dct_ssse3.obj obj/third_party/libvpx/libvpx_intrinsics_ssse3/vp9_frame_scale_ssse3.obj obj/third_party/libvpx/libvpx_intrinsics_ssse3/inv_txfm_ssse3.obj obj/third_party/libvpx/libvpx_intrinsics_ssse3/vpx_subpixel_8t_intrin_ssse3.obj
  )

elseif (APPLE)
  # from api/peerconnection_client.ninja, WebRTC branch-heads/60

  list(APPEND _WEBRTC_LIB_NAMES
    obj/webrtc/base/librtc_base.a obj/webrtc/base/librtc_base_approved.a obj/webrtc/media/librtc_media.a obj/webrtc/modules/video_capture/libvideo_capture_module.a obj/webrtc/pc/libjingle_peerconnection.a obj/webrtc/system_wrappers/libfield_trial_default.a obj/webrtc/system_wrappers/libmetrics_default.a obj/third_party/libyuv/libyuv_internal.a obj/third_party/libjpeg_turbo/libjpeg.a obj/third_party/libjpeg_turbo/libsimd.a obj/third_party/libjpeg_turbo/libsimd_asm.a obj/webrtc/api/libjingle_peerconnection_api.a obj/webrtc/libwebrtc_common.a obj/third_party/boringssl/libboringssl.a obj/webrtc/system_wrappers/libsystem_wrappers.a obj/third_party/usrsctp/libusrsctp.a obj/webrtc/modules/video_capture/libvideo_capture_internal_impl.a obj/webrtc/common_video/libcommon_video.a obj/webrtc/base/librtc_task_queue.a obj/third_party/protobuf/libprotobuf_lite.a obj/webrtc/modules/audio_processing/libaudioproc_debug_proto.a obj/webrtc/media/librtc_media_base.a obj/webrtc/api/audio_codecs/libbuiltin_audio_encoder_factory.a obj/webrtc/modules/audio_coding/libbuiltin_audio_encoder_factory_internal.a obj/webrtc/modules/audio_coding/libcng.a obj/webrtc/common_audio/libcommon_audio.a obj/third_party/openmax_dl/dl/libdl.a obj/webrtc/common_audio/libcommon_audio_sse2.a obj/webrtc/modules/audio_coding/libg711.a obj/webrtc/modules/audio_coding/liblegacy_encoded_audio_frame.a obj/webrtc/modules/audio_coding/libpcm16b.a obj/webrtc/modules/audio_coding/libilbc.a obj/webrtc/modules/audio_coding/libwebrtc_opus.a obj/third_party/opus/libopus.a obj/webrtc/modules/audio_coding/libaudio_network_adaptor.a obj/webrtc/modules/audio_coding/libana_config_proto.a obj/webrtc/modules/audio_coding/libana_debug_dump_proto.a obj/webrtc/base/librtc_numerics.a obj/webrtc/modules/audio_coding/libisac.a obj/webrtc/modules/audio_coding/libisac_c.a obj/webrtc/modules/audio_coding/libisac_common.a obj/webrtc/modules/audio_coding/libg722.a obj/webrtc/modules/audio_coding/libred.a obj/webrtc/p2p/libstunprober.a obj/webrtc/p2p/librtc_p2p.a obj/webrtc/api/audio_codecs/libbuiltin_audio_decoder_factory.a obj/webrtc/modules/audio_coding/libbuiltin_audio_decoder_factory_internal.a obj/webrtc/call/libcall.a obj/webrtc/audio/libaudio.a obj/webrtc/modules/audio_device/libaudio_device.a obj/webrtc/modules/utility/libutility.a obj/webrtc/audio/utility/libaudio_frame_operations.a obj/webrtc/modules/audio_coding/libaudio_format_conversion.a obj/webrtc/modules/media_file/libmedia_file.a obj/webrtc/modules/audio_processing/libaudio_processing.a obj/webrtc/modules/audio_processing/libaudio_processing_sse2.a obj/webrtc/modules/bitrate_controller/libbitrate_controller.a obj/webrtc/modules/rtp_rtcp/librtp_rtcp.a obj/webrtc/modules/remote_bitrate_estimator/libremote_bitrate_estimator.a obj/webrtc/modules/congestion_controller/libcongestion_controller.a obj/webrtc/modules/pacing/libpacing.a obj/webrtc/voice_engine/libvoice_engine.a obj/webrtc/modules/audio_coding/libaudio_coding.a obj/webrtc/modules/audio_coding/libneteq.a obj/webrtc/modules/audio_coding/libisac_fix.a obj/webrtc/modules/audio_coding/librent_a_codec.a obj/webrtc/voice_engine/libaudio_level.a obj/webrtc/voice_engine/libfile_player.a obj/webrtc/voice_engine/libaudio_coder.a obj/webrtc/voice_engine/libfile_recorder.a obj/webrtc/modules/audio_conference_mixer/libaudio_conference_mixer.a obj/webrtc/logging/librtc_event_log_impl.a obj/webrtc/logging/librtc_event_log_proto.a obj/webrtc/video/libvideo.a obj/webrtc/modules/video_coding/libvideo_coding.a obj/webrtc/modules/video_coding/libvideo_coding_utility.a obj/webrtc/modules/video_coding/libwebrtc_h264.a obj/webrtc/modules/video_coding/libwebrtc_i420.a obj/webrtc/modules/video_coding/libwebrtc_vp8.a obj/third_party/libvpx/libvpx.a obj/third_party/libvpx/libvpx_yasm.a obj/webrtc/modules/video_coding/libwebrtc_vp9.a obj/webrtc/modules/video_processing/libvideo_processing.a obj/webrtc/modules/video_processing/libvideo_processing_sse2.a obj/webrtc/modules/audio_mixer/libaudio_mixer_impl.a obj/webrtc/modules/audio_mixer/libaudio_frame_manipulator.a obj/webrtc/pc/librtc_pc.a obj/third_party/libsrtp/libsrtp.a obj/webrtc/stats/librtc_stats.a
  )

  list(APPEND _WEBRTC_OBJ_NAMES
    obj/webrtc/api/video_frame_api/i420_buffer.o obj/webrtc/api/video_frame_api/video_frame.o obj/webrtc/api/video_frame_api/video_frame_buffer.o obj/webrtc/base/rtc_json/json.o obj/third_party/boringssl/boringssl_asm/chacha-x86_64.o obj/third_party/boringssl/boringssl_asm/aes128gcmsiv-x86_64.o obj/third_party/boringssl/boringssl_asm/chacha20_poly1305_x86_64.o obj/third_party/boringssl/boringssl_asm/aes-x86_64.o obj/third_party/boringssl/boringssl_asm/aesni-gcm-x86_64.o obj/third_party/boringssl/boringssl_asm/aesni-x86_64.o obj/third_party/boringssl/boringssl_asm/bsaes-x86_64.o obj/third_party/boringssl/boringssl_asm/ghash-x86_64.o obj/third_party/boringssl/boringssl_asm/md5-x86_64.o obj/third_party/boringssl/boringssl_asm/p256-x86_64-asm.o obj/third_party/boringssl/boringssl_asm/rdrand-x86_64.o obj/third_party/boringssl/boringssl_asm/rsaz-avx2.o obj/third_party/boringssl/boringssl_asm/sha1-x86_64.o obj/third_party/boringssl/boringssl_asm/sha256-x86_64.o obj/third_party/boringssl/boringssl_asm/sha512-x86_64.o obj/third_party/boringssl/boringssl_asm/vpaes-x86_64.o obj/third_party/boringssl/boringssl_asm/x86_64-mont.o obj/third_party/boringssl/boringssl_asm/x86_64-mont5.o obj/third_party/boringssl/boringssl_asm/x25519-asm-x86_64.o obj/webrtc/api/audio_codecs/audio_codecs_api/audio_decoder.o obj/webrtc/api/audio_codecs/audio_codecs_api/audio_encoder.o obj/webrtc/api/audio_codecs/audio_codecs_api/audio_format.o obj/third_party/jsoncpp/jsoncpp/json_reader.o obj/third_party/jsoncpp/jsoncpp/json_value.o obj/third_party/jsoncpp/jsoncpp/json_writer.o obj/webrtc/modules/audio_processing/aec_dump/aec_dump_impl/aec_dump_impl.o obj/webrtc/modules/audio_processing/aec_dump/aec_dump_impl/capture_stream_info.o obj/webrtc/modules/audio_processing/aec_dump/aec_dump_impl/write_to_file_task.o obj/webrtc/modules/audio_processing/aec_dump_interface/aec_dump.o obj/webrtc/common_audio/common_audio_c/fft4g.o obj/webrtc/common_audio/common_audio_c/ring_buffer.o obj/webrtc/common_audio/common_audio_c/auto_corr_to_refl_coef.o obj/webrtc/common_audio/common_audio_c/auto_correlation.o obj/webrtc/common_audio/common_audio_c/copy_set_operations.o obj/webrtc/common_audio/common_audio_c/cross_correlation.o obj/webrtc/common_audio/common_audio_c/division_operations.o obj/webrtc/common_audio/common_audio_c/downsample_fast.o obj/webrtc/common_audio/common_audio_c/energy.o obj/webrtc/common_audio/common_audio_c/filter_ar.o obj/webrtc/common_audio/common_audio_c/filter_ma_fast_q12.o obj/webrtc/common_audio/common_audio_c/get_hanning_window.o obj/webrtc/common_audio/common_audio_c/get_scaling_square.o obj/webrtc/common_audio/common_audio_c/ilbc_specific_functions.o obj/webrtc/common_audio/common_audio_c/levinson_durbin.o obj/webrtc/common_audio/common_audio_c/lpc_to_refl_coef.o obj/webrtc/common_audio/common_audio_c/min_max_operations.o obj/webrtc/common_audio/common_audio_c/randomization_functions.o obj/webrtc/common_audio/common_audio_c/real_fft.o obj/webrtc/common_audio/common_audio_c/refl_coef_to_lpc.o obj/webrtc/common_audio/common_audio_c/resample.o obj/webrtc/common_audio/common_audio_c/resample_48khz.o obj/webrtc/common_audio/common_audio_c/resample_by_2.o obj/webrtc/common_audio/common_audio_c/resample_by_2_internal.o obj/webrtc/common_audio/common_audio_c/resample_fractional.o obj/webrtc/common_audio/common_audio_c/spl_init.o obj/webrtc/common_audio/common_audio_c/spl_inl.o obj/webrtc/common_audio/common_audio_c/spl_sqrt.o obj/webrtc/common_audio/common_audio_c/splitting_filter.o obj/webrtc/common_audio/common_audio_c/sqrt_of_one_minus_x_squared.o obj/webrtc/common_audio/common_audio_c/vector_scaling_operations.o obj/webrtc/common_audio/common_audio_c/vad_core.o obj/webrtc/common_audio/common_audio_c/vad_filterbank.o obj/webrtc/common_audio/common_audio_c/vad_gmm.o obj/webrtc/common_audio/common_audio_c/vad_sp.o obj/webrtc/common_audio/common_audio_c/webrtc_vad.o obj/webrtc/common_audio/common_audio_c/complex_fft.o obj/webrtc/common_audio/common_audio_c/complex_bit_reverse.o obj/webrtc/common_audio/common_audio_c/filter_ar_fast_q12.o obj/webrtc/common_audio/common_audio_c/spl_sqrt_floor.o obj/webrtc/common_audio/common_audio_cc/dot_product_with_scale.o obj/webrtc/modules/audio_coding/g711_c/g711.o obj/webrtc/modules/audio_coding/g711_c/g711_interface.o obj/webrtc/modules/audio_coding/pcm16b_c/pcm16b.o obj/webrtc/modules/audio_coding/ilbc_c/abs_quant.o obj/webrtc/modules/audio_coding/ilbc_c/abs_quant_loop.o obj/webrtc/modules/audio_coding/ilbc_c/augmented_cb_corr.o obj/webrtc/modules/audio_coding/ilbc_c/bw_expand.o obj/webrtc/modules/audio_coding/ilbc_c/cb_construct.o obj/webrtc/modules/audio_coding/ilbc_c/cb_mem_energy.o obj/webrtc/modules/audio_coding/ilbc_c/cb_mem_energy_augmentation.o obj/webrtc/modules/audio_coding/ilbc_c/cb_mem_energy_calc.o obj/webrtc/modules/audio_coding/ilbc_c/cb_search.o obj/webrtc/modules/audio_coding/ilbc_c/cb_search_core.o obj/webrtc/modules/audio_coding/ilbc_c/cb_update_best_index.o obj/webrtc/modules/audio_coding/ilbc_c/chebyshev.o obj/webrtc/modules/audio_coding/ilbc_c/comp_corr.o obj/webrtc/modules/audio_coding/ilbc_c/constants.o obj/webrtc/modules/audio_coding/ilbc_c/create_augmented_vec.o obj/webrtc/modules/audio_coding/ilbc_c/decode.o obj/webrtc/modules/audio_coding/ilbc_c/decode_residual.o obj/webrtc/modules/audio_coding/ilbc_c/decoder_interpolate_lsf.o obj/webrtc/modules/audio_coding/ilbc_c/do_plc.o obj/webrtc/modules/audio_coding/ilbc_c/encode.o obj/webrtc/modules/audio_coding/ilbc_c/energy_inverse.o obj/webrtc/modules/audio_coding/ilbc_c/enh_upsample.o obj/webrtc/modules/audio_coding/ilbc_c/enhancer.o obj/webrtc/modules/audio_coding/ilbc_c/enhancer_interface.o obj/webrtc/modules/audio_coding/ilbc_c/filtered_cb_vecs.o obj/webrtc/modules/audio_coding/ilbc_c/frame_classify.o obj/webrtc/modules/audio_coding/ilbc_c/gain_dequant.o obj/webrtc/modules/audio_coding/ilbc_c/gain_quant.o obj/webrtc/modules/audio_coding/ilbc_c/get_cd_vec.o obj/webrtc/modules/audio_coding/ilbc_c/get_lsp_poly.o obj/webrtc/modules/audio_coding/ilbc_c/get_sync_seq.o obj/webrtc/modules/audio_coding/ilbc_c/hp_input.o obj/webrtc/modules/audio_coding/ilbc_c/hp_output.o obj/webrtc/modules/audio_coding/ilbc_c/ilbc.o obj/webrtc/modules/audio_coding/ilbc_c/index_conv_dec.o obj/webrtc/modules/audio_coding/ilbc_c/index_conv_enc.o obj/webrtc/modules/audio_coding/ilbc_c/init_decode.o obj/webrtc/modules/audio_coding/ilbc_c/init_encode.o obj/webrtc/modules/audio_coding/ilbc_c/interpolate.o obj/webrtc/modules/audio_coding/ilbc_c/interpolate_samples.o obj/webrtc/modules/audio_coding/ilbc_c/lpc_encode.o obj/webrtc/modules/audio_coding/ilbc_c/lsf_check.o obj/webrtc/modules/audio_coding/ilbc_c/lsf_interpolate_to_poly_dec.o obj/webrtc/modules/audio_coding/ilbc_c/lsf_interpolate_to_poly_enc.o obj/webrtc/modules/audio_coding/ilbc_c/lsf_to_lsp.o obj/webrtc/modules/audio_coding/ilbc_c/lsf_to_poly.o obj/webrtc/modules/audio_coding/ilbc_c/lsp_to_lsf.o obj/webrtc/modules/audio_coding/ilbc_c/my_corr.o obj/webrtc/modules/audio_coding/ilbc_c/nearest_neighbor.o obj/webrtc/modules/audio_coding/ilbc_c/pack_bits.o obj/webrtc/modules/audio_coding/ilbc_c/poly_to_lsf.o obj/webrtc/modules/audio_coding/ilbc_c/poly_to_lsp.o obj/webrtc/modules/audio_coding/ilbc_c/refiner.o obj/webrtc/modules/audio_coding/ilbc_c/simple_interpolate_lsf.o obj/webrtc/modules/audio_coding/ilbc_c/simple_lpc_analysis.o obj/webrtc/modules/audio_coding/ilbc_c/simple_lsf_dequant.o obj/webrtc/modules/audio_coding/ilbc_c/simple_lsf_quant.o obj/webrtc/modules/audio_coding/ilbc_c/smooth.o obj/webrtc/modules/audio_coding/ilbc_c/smooth_out_data.o obj/webrtc/modules/audio_coding/ilbc_c/sort_sq.o obj/webrtc/modules/audio_coding/ilbc_c/split_vq.o obj/webrtc/modules/audio_coding/ilbc_c/state_construct.o obj/webrtc/modules/audio_coding/ilbc_c/state_search.o obj/webrtc/modules/audio_coding/ilbc_c/swap_bytes.o obj/webrtc/modules/audio_coding/ilbc_c/unpack_bits.o obj/webrtc/modules/audio_coding/ilbc_c/vq3.o obj/webrtc/modules/audio_coding/ilbc_c/vq4.o obj/webrtc/modules/audio_coding/ilbc_c/window32_w32.o obj/webrtc/modules/audio_coding/ilbc_c/xcorr_coef.o obj/webrtc/modules/audio_coding/webrtc_opus_c/opus_interface.o obj/webrtc/call/call_interfaces/audio_send_stream.o obj/webrtc/call/call_interfaces/syncable.o obj/webrtc/modules/audio_coding/g722_c/g722_decode.o obj/webrtc/modules/audio_coding/g722_c/g722_encode.o obj/webrtc/modules/audio_coding/g722_c/g722_interface.o obj/webrtc/api/ortc_api/mediadescription.o obj/webrtc/api/ortc_api/sessiondescription.o obj/webrtc/modules/audio_device/mac_portaudio/pa_ringbuffer.o obj/webrtc/modules/audio_processing/audio_processing_c/analog_agc.o obj/webrtc/modules/audio_processing/audio_processing_c/digital_agc.o obj/webrtc/modules/audio_processing/audio_processing_c/noise_suppression.o obj/webrtc/modules/audio_processing/audio_processing_c/ns_core.o obj/webrtc/modules/audio_coding/isac_fix_c/arith_routines.o obj/webrtc/modules/audio_coding/isac_fix_c/arith_routines_hist.o obj/webrtc/modules/audio_coding/isac_fix_c/arith_routines_logist.o obj/webrtc/modules/audio_coding/isac_fix_c/bandwidth_estimator.o obj/webrtc/modules/audio_coding/isac_fix_c/decode.o obj/webrtc/modules/audio_coding/isac_fix_c/decode_bwe.o obj/webrtc/modules/audio_coding/isac_fix_c/decode_plc.o obj/webrtc/modules/audio_coding/isac_fix_c/encode.o obj/webrtc/modules/audio_coding/isac_fix_c/entropy_coding.o obj/webrtc/modules/audio_coding/isac_fix_c/filterbank_tables.o obj/webrtc/modules/audio_coding/isac_fix_c/filterbanks.o obj/webrtc/modules/audio_coding/isac_fix_c/filters.o obj/webrtc/modules/audio_coding/isac_fix_c/initialize.o obj/webrtc/modules/audio_coding/isac_fix_c/isacfix.o obj/webrtc/modules/audio_coding/isac_fix_c/lattice.o obj/webrtc/modules/audio_coding/isac_fix_c/lattice_c.o obj/webrtc/modules/audio_coding/isac_fix_c/lpc_masking_model.o obj/webrtc/modules/audio_coding/isac_fix_c/lpc_tables.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_estimator.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_estimator_c.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_filter.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_filter_c.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_gain_tables.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_lag_tables.o obj/webrtc/modules/audio_coding/isac_fix_c/spectrum_ar_model_tables.o obj/webrtc/modules/audio_coding/isac_fix_c/transform.o obj/webrtc/modules/audio_coding/isac_fix_c/transform_tables.o obj/webrtc/modules/audio_coding/isac_fix_common/fft.o obj/webrtc/modules/audio_coding/neteq_decoder_enum/neteq_decoder_enum.o obj/third_party/libvpx/libvpx_intrinsics_avx/vp9_diamond_search_sad_avx.o obj/third_party/libvpx/libvpx_intrinsics_avx2/vp9_error_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/fwd_txfm_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/highbd_convolve_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/loopfilter_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/sad4d_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/sad_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/variance_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/variance_impl_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/vpx_subpixel_8t_intrin_avx2.o obj/third_party/libvpx/libvpx_intrinsics_mmx/idct_blk_mmx.o obj/third_party/libvpx/libvpx_intrinsics_mmx/vp8_enc_stubs_mmx.o obj/third_party/libvpx/libvpx_intrinsics_sse2/idct_blk_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/denoising_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp8_enc_stubs_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp8_quantize_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_idct_intrin_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_dct_intrin_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_denoiser_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_highbd_block_error_intrin_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_quantize_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/avg_intrin_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/avg_pred_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/fwd_txfm_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct16x16_add_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct32x32_add_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct4x4_add_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct8x8_add_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_loopfilter_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_quantize_intrin_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_variance_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/inv_txfm_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/loopfilter_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/quantize_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/sum_squares_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/variance_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse4_1/quantize_sse4.o obj/third_party/libvpx/libvpx_intrinsics_sse4_1/temporal_filter_sse4.o obj/third_party/libvpx/libvpx_intrinsics_ssse3/quantize_ssse3.o obj/third_party/libvpx/libvpx_intrinsics_ssse3/vp9_dct_ssse3.o obj/third_party/libvpx/libvpx_intrinsics_ssse3/vp9_frame_scale_ssse3.o obj/third_party/libvpx/libvpx_intrinsics_ssse3/inv_txfm_ssse3.o obj/third_party/libvpx/libvpx_intrinsics_ssse3/vpx_subpixel_8t_intrin_ssse3.o
    )    
elseif (UNIX)
  # from peerconnection_client.ninja, WebRTC branch-heads/60
  list(APPEND _WEBRTC_LIB_NAMES
    obj/webrtc/base/librtc_base.a obj/webrtc/base/librtc_base_approved.a obj/webrtc/media/librtc_media.a obj/webrtc/modules/video_capture/libvideo_capture_module.a obj/webrtc/pc/libjingle_peerconnection.a obj/webrtc/system_wrappers/libfield_trial_default.a obj/webrtc/system_wrappers/libmetrics_default.a obj/third_party/libyuv/libyuv_internal.a obj/third_party/libjpeg_turbo/libjpeg.a obj/third_party/libjpeg_turbo/libsimd.a obj/third_party/libjpeg_turbo/libsimd_asm.a obj/webrtc/api/libjingle_peerconnection_api.a obj/webrtc/libwebrtc_common.a obj/third_party/boringssl/libboringssl.a obj/webrtc/system_wrappers/libsystem_wrappers.a obj/webrtc/system_wrappers/libcpu_features_linux.a obj/third_party/usrsctp/libusrsctp.a obj/webrtc/modules/video_capture/libvideo_capture_internal_impl.a obj/webrtc/common_video/libcommon_video.a obj/webrtc/base/librtc_task_queue.a obj/base/third_party/libevent/libevent.a obj/third_party/protobuf/libprotobuf_lite.a obj/webrtc/modules/audio_processing/libaudioproc_debug_proto.a obj/webrtc/media/librtc_media_base.a obj/webrtc/api/audio_codecs/libbuiltin_audio_encoder_factory.a obj/webrtc/modules/audio_coding/libbuiltin_audio_encoder_factory_internal.a obj/webrtc/modules/audio_coding/libcng.a obj/webrtc/common_audio/libcommon_audio.a obj/third_party/openmax_dl/dl/libdl.a obj/webrtc/common_audio/libcommon_audio_sse2.a obj/webrtc/modules/audio_coding/libg711.a obj/webrtc/modules/audio_coding/liblegacy_encoded_audio_frame.a obj/webrtc/modules/audio_coding/libpcm16b.a obj/webrtc/modules/audio_coding/libilbc.a obj/webrtc/modules/audio_coding/libwebrtc_opus.a obj/third_party/opus/libopus.a obj/webrtc/modules/audio_coding/libaudio_network_adaptor.a obj/webrtc/modules/audio_coding/libana_config_proto.a obj/webrtc/modules/audio_coding/libana_debug_dump_proto.a obj/webrtc/base/librtc_numerics.a obj/webrtc/modules/audio_coding/libisac.a obj/webrtc/modules/audio_coding/libisac_c.a obj/webrtc/modules/audio_coding/libisac_common.a obj/webrtc/modules/audio_coding/libg722.a obj/webrtc/modules/audio_coding/libred.a obj/webrtc/p2p/libstunprober.a obj/webrtc/p2p/librtc_p2p.a obj/webrtc/api/audio_codecs/libbuiltin_audio_decoder_factory.a obj/webrtc/modules/audio_coding/libbuiltin_audio_decoder_factory_internal.a obj/webrtc/call/libcall.a obj/webrtc/audio/libaudio.a obj/webrtc/modules/audio_device/libaudio_device.a obj/webrtc/modules/utility/libutility.a obj/webrtc/audio/utility/libaudio_frame_operations.a obj/webrtc/modules/audio_coding/libaudio_format_conversion.a obj/webrtc/modules/media_file/libmedia_file.a obj/webrtc/modules/audio_processing/libaudio_processing.a obj/webrtc/modules/audio_processing/libaudio_processing_sse2.a obj/webrtc/modules/bitrate_controller/libbitrate_controller.a obj/webrtc/modules/rtp_rtcp/librtp_rtcp.a obj/webrtc/modules/remote_bitrate_estimator/libremote_bitrate_estimator.a obj/webrtc/modules/congestion_controller/libcongestion_controller.a obj/webrtc/modules/pacing/libpacing.a obj/webrtc/voice_engine/libvoice_engine.a obj/webrtc/modules/audio_coding/libaudio_coding.a obj/webrtc/modules/audio_coding/libneteq.a obj/webrtc/modules/audio_coding/libisac_fix.a obj/webrtc/modules/audio_coding/librent_a_codec.a obj/webrtc/voice_engine/libaudio_level.a obj/webrtc/voice_engine/libfile_player.a obj/webrtc/voice_engine/libaudio_coder.a obj/webrtc/voice_engine/libfile_recorder.a obj/webrtc/modules/audio_conference_mixer/libaudio_conference_mixer.a obj/webrtc/logging/librtc_event_log_impl.a obj/webrtc/logging/librtc_event_log_proto.a obj/webrtc/video/libvideo.a obj/webrtc/modules/video_coding/libvideo_coding.a obj/webrtc/modules/video_coding/libvideo_coding_utility.a obj/webrtc/modules/video_coding/libwebrtc_h264.a obj/webrtc/modules/video_coding/libwebrtc_i420.a obj/webrtc/modules/video_coding/libwebrtc_vp8.a obj/third_party/libvpx/libvpx.a obj/third_party/libvpx/libvpx_yasm.a obj/webrtc/modules/video_coding/libwebrtc_vp9.a obj/webrtc/modules/video_processing/libvideo_processing.a obj/webrtc/modules/video_processing/libvideo_processing_sse2.a obj/webrtc/modules/audio_mixer/libaudio_mixer_impl.a obj/webrtc/modules/audio_mixer/libaudio_frame_manipulator.a obj/webrtc/pc/librtc_pc.a obj/third_party/libsrtp/libsrtp.a obj/webrtc/stats/librtc_stats.a
    )
    
  list(APPEND _WEBRTC_OBJ_NAMES
    obj/webrtc/api/video_frame_api/i420_buffer.o obj/webrtc/api/video_frame_api/video_frame.o obj/webrtc/api/video_frame_api/video_frame_buffer.o obj/webrtc/base/rtc_json/json.o obj/third_party/boringssl/boringssl_asm/chacha-x86_64.o obj/third_party/boringssl/boringssl_asm/aes128gcmsiv-x86_64.o obj/third_party/boringssl/boringssl_asm/chacha20_poly1305_x86_64.o obj/third_party/boringssl/boringssl_asm/aes-x86_64.o obj/third_party/boringssl/boringssl_asm/aesni-gcm-x86_64.o obj/third_party/boringssl/boringssl_asm/aesni-x86_64.o obj/third_party/boringssl/boringssl_asm/bsaes-x86_64.o obj/third_party/boringssl/boringssl_asm/ghash-x86_64.o obj/third_party/boringssl/boringssl_asm/md5-x86_64.o obj/third_party/boringssl/boringssl_asm/p256-x86_64-asm.o obj/third_party/boringssl/boringssl_asm/rdrand-x86_64.o obj/third_party/boringssl/boringssl_asm/rsaz-avx2.o obj/third_party/boringssl/boringssl_asm/sha1-x86_64.o obj/third_party/boringssl/boringssl_asm/sha256-x86_64.o obj/third_party/boringssl/boringssl_asm/sha512-x86_64.o obj/third_party/boringssl/boringssl_asm/vpaes-x86_64.o obj/third_party/boringssl/boringssl_asm/x86_64-mont.o obj/third_party/boringssl/boringssl_asm/x86_64-mont5.o obj/third_party/boringssl/boringssl_asm/x25519-asm-x86_64.o obj/webrtc/api/audio_codecs/audio_codecs_api/audio_decoder.o obj/webrtc/api/audio_codecs/audio_codecs_api/audio_encoder.o obj/webrtc/api/audio_codecs/audio_codecs_api/audio_format.o obj/third_party/jsoncpp/jsoncpp/json_reader.o obj/third_party/jsoncpp/jsoncpp/json_value.o obj/third_party/jsoncpp/jsoncpp/json_writer.o obj/webrtc/modules/audio_processing/aec_dump/aec_dump_impl/aec_dump_impl.o obj/webrtc/modules/audio_processing/aec_dump/aec_dump_impl/capture_stream_info.o obj/webrtc/modules/audio_processing/aec_dump/aec_dump_impl/write_to_file_task.o obj/webrtc/modules/audio_processing/aec_dump_interface/aec_dump.o obj/webrtc/common_audio/common_audio_c/fft4g.o obj/webrtc/common_audio/common_audio_c/ring_buffer.o obj/webrtc/common_audio/common_audio_c/auto_corr_to_refl_coef.o obj/webrtc/common_audio/common_audio_c/auto_correlation.o obj/webrtc/common_audio/common_audio_c/copy_set_operations.o obj/webrtc/common_audio/common_audio_c/cross_correlation.o obj/webrtc/common_audio/common_audio_c/division_operations.o obj/webrtc/common_audio/common_audio_c/downsample_fast.o obj/webrtc/common_audio/common_audio_c/energy.o obj/webrtc/common_audio/common_audio_c/filter_ar.o obj/webrtc/common_audio/common_audio_c/filter_ma_fast_q12.o obj/webrtc/common_audio/common_audio_c/get_hanning_window.o obj/webrtc/common_audio/common_audio_c/get_scaling_square.o obj/webrtc/common_audio/common_audio_c/ilbc_specific_functions.o obj/webrtc/common_audio/common_audio_c/levinson_durbin.o obj/webrtc/common_audio/common_audio_c/lpc_to_refl_coef.o obj/webrtc/common_audio/common_audio_c/min_max_operations.o obj/webrtc/common_audio/common_audio_c/randomization_functions.o obj/webrtc/common_audio/common_audio_c/real_fft.o obj/webrtc/common_audio/common_audio_c/refl_coef_to_lpc.o obj/webrtc/common_audio/common_audio_c/resample.o obj/webrtc/common_audio/common_audio_c/resample_48khz.o obj/webrtc/common_audio/common_audio_c/resample_by_2.o obj/webrtc/common_audio/common_audio_c/resample_by_2_internal.o obj/webrtc/common_audio/common_audio_c/resample_fractional.o obj/webrtc/common_audio/common_audio_c/spl_init.o obj/webrtc/common_audio/common_audio_c/spl_inl.o obj/webrtc/common_audio/common_audio_c/spl_sqrt.o obj/webrtc/common_audio/common_audio_c/splitting_filter.o obj/webrtc/common_audio/common_audio_c/sqrt_of_one_minus_x_squared.o obj/webrtc/common_audio/common_audio_c/vector_scaling_operations.o obj/webrtc/common_audio/common_audio_c/vad_core.o obj/webrtc/common_audio/common_audio_c/vad_filterbank.o obj/webrtc/common_audio/common_audio_c/vad_gmm.o obj/webrtc/common_audio/common_audio_c/vad_sp.o obj/webrtc/common_audio/common_audio_c/webrtc_vad.o obj/webrtc/common_audio/common_audio_c/complex_fft.o obj/webrtc/common_audio/common_audio_c/complex_bit_reverse.o obj/webrtc/common_audio/common_audio_c/filter_ar_fast_q12.o obj/webrtc/common_audio/common_audio_c/spl_sqrt_floor.o obj/webrtc/common_audio/common_audio_cc/dot_product_with_scale.o obj/webrtc/modules/audio_coding/g711_c/g711.o obj/webrtc/modules/audio_coding/g711_c/g711_interface.o obj/webrtc/modules/audio_coding/pcm16b_c/pcm16b.o obj/webrtc/modules/audio_coding/ilbc_c/abs_quant.o obj/webrtc/modules/audio_coding/ilbc_c/abs_quant_loop.o obj/webrtc/modules/audio_coding/ilbc_c/augmented_cb_corr.o obj/webrtc/modules/audio_coding/ilbc_c/bw_expand.o obj/webrtc/modules/audio_coding/ilbc_c/cb_construct.o obj/webrtc/modules/audio_coding/ilbc_c/cb_mem_energy.o obj/webrtc/modules/audio_coding/ilbc_c/cb_mem_energy_augmentation.o obj/webrtc/modules/audio_coding/ilbc_c/cb_mem_energy_calc.o obj/webrtc/modules/audio_coding/ilbc_c/cb_search.o obj/webrtc/modules/audio_coding/ilbc_c/cb_search_core.o obj/webrtc/modules/audio_coding/ilbc_c/cb_update_best_index.o obj/webrtc/modules/audio_coding/ilbc_c/chebyshev.o obj/webrtc/modules/audio_coding/ilbc_c/comp_corr.o obj/webrtc/modules/audio_coding/ilbc_c/constants.o obj/webrtc/modules/audio_coding/ilbc_c/create_augmented_vec.o obj/webrtc/modules/audio_coding/ilbc_c/decode.o obj/webrtc/modules/audio_coding/ilbc_c/decode_residual.o obj/webrtc/modules/audio_coding/ilbc_c/decoder_interpolate_lsf.o obj/webrtc/modules/audio_coding/ilbc_c/do_plc.o obj/webrtc/modules/audio_coding/ilbc_c/encode.o obj/webrtc/modules/audio_coding/ilbc_c/energy_inverse.o obj/webrtc/modules/audio_coding/ilbc_c/enh_upsample.o obj/webrtc/modules/audio_coding/ilbc_c/enhancer.o obj/webrtc/modules/audio_coding/ilbc_c/enhancer_interface.o obj/webrtc/modules/audio_coding/ilbc_c/filtered_cb_vecs.o obj/webrtc/modules/audio_coding/ilbc_c/frame_classify.o obj/webrtc/modules/audio_coding/ilbc_c/gain_dequant.o obj/webrtc/modules/audio_coding/ilbc_c/gain_quant.o obj/webrtc/modules/audio_coding/ilbc_c/get_cd_vec.o obj/webrtc/modules/audio_coding/ilbc_c/get_lsp_poly.o obj/webrtc/modules/audio_coding/ilbc_c/get_sync_seq.o obj/webrtc/modules/audio_coding/ilbc_c/hp_input.o obj/webrtc/modules/audio_coding/ilbc_c/hp_output.o obj/webrtc/modules/audio_coding/ilbc_c/ilbc.o obj/webrtc/modules/audio_coding/ilbc_c/index_conv_dec.o obj/webrtc/modules/audio_coding/ilbc_c/index_conv_enc.o obj/webrtc/modules/audio_coding/ilbc_c/init_decode.o obj/webrtc/modules/audio_coding/ilbc_c/init_encode.o obj/webrtc/modules/audio_coding/ilbc_c/interpolate.o obj/webrtc/modules/audio_coding/ilbc_c/interpolate_samples.o obj/webrtc/modules/audio_coding/ilbc_c/lpc_encode.o obj/webrtc/modules/audio_coding/ilbc_c/lsf_check.o obj/webrtc/modules/audio_coding/ilbc_c/lsf_interpolate_to_poly_dec.o obj/webrtc/modules/audio_coding/ilbc_c/lsf_interpolate_to_poly_enc.o obj/webrtc/modules/audio_coding/ilbc_c/lsf_to_lsp.o obj/webrtc/modules/audio_coding/ilbc_c/lsf_to_poly.o obj/webrtc/modules/audio_coding/ilbc_c/lsp_to_lsf.o obj/webrtc/modules/audio_coding/ilbc_c/my_corr.o obj/webrtc/modules/audio_coding/ilbc_c/nearest_neighbor.o obj/webrtc/modules/audio_coding/ilbc_c/pack_bits.o obj/webrtc/modules/audio_coding/ilbc_c/poly_to_lsf.o obj/webrtc/modules/audio_coding/ilbc_c/poly_to_lsp.o obj/webrtc/modules/audio_coding/ilbc_c/refiner.o obj/webrtc/modules/audio_coding/ilbc_c/simple_interpolate_lsf.o obj/webrtc/modules/audio_coding/ilbc_c/simple_lpc_analysis.o obj/webrtc/modules/audio_coding/ilbc_c/simple_lsf_dequant.o obj/webrtc/modules/audio_coding/ilbc_c/simple_lsf_quant.o obj/webrtc/modules/audio_coding/ilbc_c/smooth.o obj/webrtc/modules/audio_coding/ilbc_c/smooth_out_data.o obj/webrtc/modules/audio_coding/ilbc_c/sort_sq.o obj/webrtc/modules/audio_coding/ilbc_c/split_vq.o obj/webrtc/modules/audio_coding/ilbc_c/state_construct.o obj/webrtc/modules/audio_coding/ilbc_c/state_search.o obj/webrtc/modules/audio_coding/ilbc_c/swap_bytes.o obj/webrtc/modules/audio_coding/ilbc_c/unpack_bits.o obj/webrtc/modules/audio_coding/ilbc_c/vq3.o obj/webrtc/modules/audio_coding/ilbc_c/vq4.o obj/webrtc/modules/audio_coding/ilbc_c/window32_w32.o obj/webrtc/modules/audio_coding/ilbc_c/xcorr_coef.o obj/webrtc/modules/audio_coding/webrtc_opus_c/opus_interface.o obj/webrtc/call/call_interfaces/audio_send_stream.o obj/webrtc/call/call_interfaces/syncable.o obj/webrtc/modules/audio_coding/g722_c/g722_decode.o obj/webrtc/modules/audio_coding/g722_c/g722_encode.o obj/webrtc/modules/audio_coding/g722_c/g722_interface.o obj/webrtc/api/ortc_api/mediadescription.o obj/webrtc/api/ortc_api/sessiondescription.o obj/webrtc/modules/audio_processing/audio_processing_c/analog_agc.o obj/webrtc/modules/audio_processing/audio_processing_c/digital_agc.o obj/webrtc/modules/audio_processing/audio_processing_c/noise_suppression.o obj/webrtc/modules/audio_processing/audio_processing_c/ns_core.o obj/webrtc/modules/audio_coding/isac_fix_c/arith_routines.o obj/webrtc/modules/audio_coding/isac_fix_c/arith_routines_hist.o obj/webrtc/modules/audio_coding/isac_fix_c/arith_routines_logist.o obj/webrtc/modules/audio_coding/isac_fix_c/bandwidth_estimator.o obj/webrtc/modules/audio_coding/isac_fix_c/decode.o obj/webrtc/modules/audio_coding/isac_fix_c/decode_bwe.o obj/webrtc/modules/audio_coding/isac_fix_c/decode_plc.o obj/webrtc/modules/audio_coding/isac_fix_c/encode.o obj/webrtc/modules/audio_coding/isac_fix_c/entropy_coding.o obj/webrtc/modules/audio_coding/isac_fix_c/filterbank_tables.o obj/webrtc/modules/audio_coding/isac_fix_c/filterbanks.o obj/webrtc/modules/audio_coding/isac_fix_c/filters.o obj/webrtc/modules/audio_coding/isac_fix_c/initialize.o obj/webrtc/modules/audio_coding/isac_fix_c/isacfix.o obj/webrtc/modules/audio_coding/isac_fix_c/lattice.o obj/webrtc/modules/audio_coding/isac_fix_c/lattice_c.o obj/webrtc/modules/audio_coding/isac_fix_c/lpc_masking_model.o obj/webrtc/modules/audio_coding/isac_fix_c/lpc_tables.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_estimator.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_estimator_c.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_filter.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_filter_c.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_gain_tables.o obj/webrtc/modules/audio_coding/isac_fix_c/pitch_lag_tables.o obj/webrtc/modules/audio_coding/isac_fix_c/spectrum_ar_model_tables.o obj/webrtc/modules/audio_coding/isac_fix_c/transform.o obj/webrtc/modules/audio_coding/isac_fix_c/transform_tables.o obj/webrtc/modules/audio_coding/isac_fix_common/fft.o obj/webrtc/modules/audio_coding/neteq_decoder_enum/neteq_decoder_enum.o obj/third_party/libvpx/libvpx_intrinsics_avx/vp9_diamond_search_sad_avx.o obj/third_party/libvpx/libvpx_intrinsics_avx2/vp9_error_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/fwd_txfm_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/highbd_convolve_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/loopfilter_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/sad4d_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/sad_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/variance_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/variance_impl_avx2.o obj/third_party/libvpx/libvpx_intrinsics_avx2/vpx_subpixel_8t_intrin_avx2.o obj/third_party/libvpx/libvpx_intrinsics_mmx/idct_blk_mmx.o obj/third_party/libvpx/libvpx_intrinsics_mmx/vp8_enc_stubs_mmx.o obj/third_party/libvpx/libvpx_intrinsics_sse2/idct_blk_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/denoising_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp8_enc_stubs_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp8_quantize_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_idct_intrin_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_dct_intrin_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_denoiser_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_highbd_block_error_intrin_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/vp9_quantize_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/avg_intrin_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/avg_pred_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/fwd_txfm_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct16x16_add_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct32x32_add_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct4x4_add_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_idct8x8_add_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_loopfilter_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_quantize_intrin_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/highbd_variance_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/inv_txfm_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/loopfilter_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/quantize_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/sum_squares_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse2/variance_sse2.o obj/third_party/libvpx/libvpx_intrinsics_sse4_1/quantize_sse4.o obj/third_party/libvpx/libvpx_intrinsics_sse4_1/temporal_filter_sse4.o obj/third_party/libvpx/libvpx_intrinsics_ssse3/quantize_ssse3.o obj/third_party/libvpx/libvpx_intrinsics_ssse3/vp9_dct_ssse3.o obj/third_party/libvpx/libvpx_intrinsics_ssse3/vp9_frame_scale_ssse3.o obj/third_party/libvpx/libvpx_intrinsics_ssse3/inv_txfm_ssse3.o obj/third_party/libvpx/libvpx_intrinsics_ssse3/vpx_subpixel_8t_intrin_ssse3.o
    )
else (MSVC)
    message(FATAL_ERROR "Unknown environment. \n")
endif (MSVC)

foreach (lib ${_WEBRTC_LIB_NAMES})
  unset(_WEBRTC_LIB_PATH CACHE)
  separate_arguments(lib)

  set (_WEBRTC_LIB_PATH "${WEBRTC_LIBRARY_DIR}/${lib}")

  list(APPEND WEBRTC_LIBRARIES_INTERNAL_RELEASE ${_WEBRTC_LIB_PATH})
  list(APPEND WEBRTC_LIBRARIES_INTERNAL optimized ${_WEBRTC_LIB_PATH})
endforeach()

foreach (obj ${_WEBRTC_OBJ_NAMES})
  unset(_WEBRTC_OBJ_PATH CACHE)
  separate_arguments(obj)

  set (_WEBRTC_OBJ_PATH "${WEBRTC_LIBRARY_DIR}/${obj}")

  set_source_files_properties(
    ${_WEBRTC_OBJ_PATH} PROPERTIES
    EXTERNAL_OBJECT TRUE  # Identifies this as an object file
    GENERATED TRUE  # Avoids need for file to exist at configure-time
)

  list(APPEND WEBRTC_OBJECTS_INTERNAL_RELEASE ${_WEBRTC_OBJ_PATH})
  list(APPEND WEBRTC_OBJECTS_INTERNAL optimized ${_WEBRTC_OBJ_PATH})
endforeach()

  
# Optional DEBUG library
foreach (lib ${_WEBRTC_LIB_NAMES})
  unset(_WEBRTC_LIB_PATH CACHE)
  separate_arguments(lib)

  set (_WEBRTC_LIB_PATH "${WEBRTC_LIBRARY_DIR_DEBUG}/${lib}")

  list(APPEND WEBRTC_LIBRARIES_INTERNAL_DEBUG ${_WEBRTC_LIB_PATH})
  list(APPEND WEBRTC_LIBRARIES_INTERNAL debug ${_WEBRTC_LIB_PATH})
endforeach()

foreach (obj ${_WEBRTC_OBJ_NAMES})
  unset(_WEBRTC_OBJ_PATH CACHE)
  separate_arguments(obj)

  set (_WEBRTC_OBJ_PATH "${WEBRTC_LIBRARY_DIR_DEBUG}/${obj}")

  set_source_files_properties(
    ${_WEBRTC_OBJ_PATH} PROPERTIES
    EXTERNAL_OBJECT TRUE  # Identifies this as an object file
    GENERATED TRUE  # Avoids need for file to exist at configure-time
  )

  list(APPEND WEBRTC_OBJECTS_INTERNAL_DEBUG ${_WEBRTC_OBJ_PATH})
  list(APPEND WEBRTC_OBJECTS_INTERNAL debug ${_WEBRTC_OBJ_PATH})
endforeach()


if(WIN32 AND MSVC)
  set(_WEBRTC_EXTERNAL_LIBRARIES
        Secur32.lib Winmm.lib msdmo.lib dmoguids.lib wmcodecdspuuid.lib
        wininet.lib dnsapi.lib version.lib ws2_32.lib Strmiids.lib)
  list(APPEND WEBRTC_LIBRARIES_EXTERNAL ${_WEBRTC_EXTERNAL_LIBRARIES}) 
elseif (APPLE)
  find_library(FOUNDATION_LIBRARY Foundation)
  find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)
  find_library(CORE_SERVICES_LIBRARY CoreServices)
  find_library(CORE_AUDIO_LIBRARY CoreAudio)
  find_library(AUDIO_TOOLBOX_LIBRARY AudioToolBox)
  find_library(CORE_GRAPHICSLIBRARY CoreGraphics)
  find_library(CORE_VIDEO_LIBRARY CoreVideo)
  find_library(QTKIT_LIBRARY QTKit)
  find_library(COCOA_LIBRARY Cocoa)

  list(APPEND WEBRTC_LIBRARIES_EXTERNAL ${FOUNDATION_LIBRARY})    
  list(APPEND WEBRTC_LIBRARIES_EXTERNAL ${CORE_FOUNDATION_LIBRARY})    
  list(APPEND WEBRTC_LIBRARIES_EXTERNAL ${CORE_SERVICES_LIBRARY})    
  list(APPEND WEBRTC_LIBRARIES_EXTERNAL ${CORE_AUDIO_LIBRARY})    
  list(APPEND WEBRTC_LIBRARIES_EXTERNAL ${AUDIO_TOOLBOX_LIBRARY})    
  list(APPEND WEBRTC_LIBRARIES_EXTERNAL ${CORE_GRAPHICSLIBRARY})   
  list(APPEND WEBRTC_LIBRARIES_EXTERNAL ${CORE_VIDEO_LIBRARY})
  list(APPEND WEBRTC_LIBRARIES_EXTERNAL ${QTKIT_LIBRARY})
  list(APPEND WEBRTC_LIBRARIES_EXTERNAL ${COCOA_LIBRARY})
elseif (UNIX)
  find_package(Threads REQUIRED)
  find_library(X11_LIBRARY NAMES X11)

  list(APPEND WEBRTC_LIBRARIES_EXTERNAL
              ${CMAKE_THREAD_LIBS_INIT}
              ${X11_LIBRARY}
              ${CMAKE_DL_LIBS})
endif()
  

# ============================================================================
# Definitions
# ============================================================================

if (MSVC)
  set(WEBRTC_DEFINES
    # from peerconnection_client.ninja, WebRTC branch-heads/60

    -DV8_DEPRECATION_WARNINGS -DUSE_AURA=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=1 -DWIN32 -D_SECURE_ATL -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DEXPAT_RELATIVE_PATH -DHAVE_SCTP -DWEBRTC_WIN -D_CRT_SECURE_NO_WARNINGS -DHAVE_WEBRTC_VIDEO -DHAVE_WEBRTC_VOICE

    # Removed from origianl peerconnection_client.ninja 
    # -D_USING_V110_SDK71_ -DNTDDI_VERSION=0x0A000000 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNDEBUG
  )
elseif (APPLE)
  # from peerconnection_client.ninja, WebRTC branch-heads/60
  set(WEBRTC_DEFINES
    -DV8_DEPRECATION_WARNINGS -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DEXPAT_RELATIVE_PATH -DHAVE_SCTP -DWEBRTC_POSIX -DWEBRTC_MAC -DHAVE_WEBRTC_VIDEO -DHAVE_WEBRTC_VOICE

    # Removed from original peerconnection_client.ninja
    # -DCR_CLANG_REVISION=\"303369-1\" -DCR_XCODE_VERSION=0833 -DNDEBUG 
  )

elseif (UNIX)
  # from peerconnection_client.ninja, WebRTC branch-heads/60
  set(WEBRTC_DEFINES
    -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DEXPAT_RELATIVE_PATH -DHAVE_SCTP -DWEBRTC_POSIX -DWEBRTC_LINUX -DWEBRTC_BUILD_LIBEVENT -DHAVE_WEBRTC_VIDEO -DHAVE_WEBRTC_VOICE
    
    # Removed from original peerconnection_client.ninja
    # -DCR_CLANG_REVISION=\"303369-1\" -DNDEBUG 
  )

endif (MSVC)


# ============================================================================
# Validation
# ============================================================================

if (WEBRTC_INCLUDE_DIR)
  message("Found WebRTC library successfully.")
  set(WEBRTC_FOUND 1)
else()
  set(WEBRTC_FOUND 0)
  message(FATAL_ERROR "WebRTC file was not found.\n"
      "Please check 'WEBRTC_ROOT_DIR'.\n")
endif()