gecko-dev/media/webrtc/moz.build
Eric Rahm 2d1b7da05b Bug 1354207 - Set webrtc build flags when building under valgrind, etc. r=jesup
The webrtc gyp files have a 'build_for_tool' flag that controls among other
things what defines are provided at build time. This meant that during a
firefox valgrind build webrtc would still specify NVALGRIND, thus disabling
some valgrind macros. Similarly there are flags for asan and tsan that we
should probably have been specifying as well. This patch sets the
'build_for_tool' flag to the appropriate value when building under valgrind,
asan, and tsan.
2017-04-07 09:20:37 -07:00

136 lines
8.7 KiB
Python

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files("**"):
BUG_COMPONENT = ("Core", "WebRTC")
with Files("signaling/**"):
BUG_COMPONENT = ("Core", "WebRTC: Signaling")
include('/build/gyp.mozbuild')
webrtc_non_unified_sources = [
'trunk/webrtc/common_audio/vad/vad_core.c', # Because of name clash in the kInitCheck variable
'trunk/webrtc/common_audio/vad/webrtc_vad.c', # Because of name clash in the kInitCheck variable
'trunk/webrtc/modules/audio_coding/acm2/codec_manager.cc', # Because of duplicate IsCodecRED/etc
'trunk/webrtc/modules/audio_coding/codecs/g722/g722_decode.c', # Because of name clash in the saturate function
'trunk/webrtc/modules/audio_coding/codecs/g722/g722_encode.c', # Because of name clash in the saturate function
'trunk/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c', # Because of name clash in the kDampFilter variable
'trunk/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_c.c', # Because of name clash in the kDampFilter variable
'trunk/webrtc/modules/audio_coding/neteq/audio_vector.cc', # Because of explicit template specializations
'trunk/webrtc/modules/audio_device/android/audio_manager.cc', # Because of TAG redefinition
'trunk/webrtc/modules/audio_device/android/audio_record_jni.cc', # Becuse of commonly named module static vars
'trunk/webrtc/modules/audio_device/android/audio_track_jni.cc', # Becuse of commonly named module static vars
'trunk/webrtc/modules/audio_device/android/opensles_player.cc', # Because of TAG redefinition
'trunk/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc', # Because of LATE()
'trunk/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc',# Because of LATE()
'trunk/webrtc/modules/audio_device/opensl/single_rw_fifo.cc', # Because of name clash with #define FF
'trunk/webrtc/modules/audio_device/win/audio_device_core_win.cc', # Because of ordering assumptions in strsafe.h
'trunk/webrtc/modules/audio_processing/aec/aec_core.c', # Because of name clash in the ComfortNoise function
'trunk/webrtc/modules/audio_processing/aecm/aecm_core.c', # Because of name clash in the ComfortNoise function
'trunk/webrtc/modules/audio_processing/aecm/echo_control_mobile.c', # Because of name clash in the kInitCheck variable
'trunk/webrtc/modules/audio_processing/agc/histogram.cc', # Because of duplicate definition of static consts with pitch_based_vad.cc
'trunk/webrtc/modules/audio_processing/agc/legacy/analog_agc.c', # Because of name clash in the kInitCheck variable
'trunk/webrtc/modules/audio_processing/beamformer/covariance_matrix_generator.cc', # Because of needing to define _USE_MATH_DEFINES before including <cmath>
'trunk/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc', # Because of needing to define _USE_MATH_DEFINES before including <cmath>
'trunk/webrtc/modules/audio_processing/echo_cancellation_impl.cc', # Because of name clash in the MapError function
'trunk/webrtc/modules/audio_processing/echo_control_mobile_impl.cc', # Because of name clash in the MapError function
'trunk/webrtc/modules/audio_processing/gain_control_impl.cc', # Because of name clash in the Handle typedef
'trunk/webrtc/modules/audio_processing/high_pass_filter_impl.cc', # Because of name clash in the Handle typedef
'trunk/webrtc/modules/audio_processing/noise_suppression_impl.cc', # Because of name clash in the Handle typedef
'trunk/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc', # Because of duplicate definitions of static consts against remote_bitrate_estimator_abs_send_time.cc
'trunk/webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.cc', # Because of identically named functions and vars between tmmbr.cc and tmmbn.cc in an anonymous namespaces
'trunk/webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.cc', # Because of identically named functions and vars between tmmbr.cc and tmmbn.cc in an anonymous namespaces
'trunk/webrtc/modules/video_capture/android/device_info_android.cc', # Because of duplicate module static variable names
'trunk/webrtc/modules/video_capture/android/video_capture_android.cc', # Because of duplicate module static variable names
'trunk/webrtc/modules/video_capture/windows/device_info_ds.cc', # Because of the MEDIASUBTYPE_HDYC variable
'trunk/webrtc/modules/video_capture/windows/help_functions_ds.cc', # Because of initguid.h
'trunk/webrtc/modules/video_capture/windows/sink_filter_ds.cc', # Because of the MEDIASUBTYPE_HDYC variable and initguid.h
'trunk/webrtc/video/overuse_frame_detector.cc', # Because of name clash with call_stats.cc on kWeightFactor
]
GYP_DIRS += ['trunk']
# Set gyp vars that webrtc needs when building under various analysis tools.
# Primarily this prevents webrtc from setting NVALGRIND and breaking builds.
gyp_vars_copy = gyp_vars.copy()
if CONFIG['MOZ_VALGRIND']:
gyp_vars_copy.update(build_for_tool="memcheck")
elif CONFIG['MOZ_ASAN']:
gyp_vars_copy.update(build_for_tool="asan")
elif CONFIG['MOZ_TSAN']:
gyp_vars_copy.update(build_for_tool="tsan")
GYP_DIRS['trunk'].input = 'trunk/peerconnection.gyp'
GYP_DIRS['trunk'].variables = gyp_vars_copy
# We allow warnings for third-party code that can be updated from upstream.
GYP_DIRS['trunk'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
GYP_DIRS['trunk'].sandbox_vars['FINAL_LIBRARY'] = 'webrtc'
GYP_DIRS['trunk'].non_unified_sources += webrtc_non_unified_sources
if CONFIG['ENABLE_TESTS']:
TEST_DIRS += [
'trunk/gtest',
]
if CONFIG['MOZ_WEBRTC_SIGNALING']:
GYP_DIRS += ['signaling']
GYP_DIRS['signaling'].input = 'signaling/signaling.gyp'
GYP_DIRS['signaling'].variables = gyp_vars_copy.copy()
GYP_DIRS['signaling'].variables.update(
build_for_test=0,
build_for_standalone=0
)
GYP_DIRS['signaling'].sandbox_vars['FINAL_LIBRARY'] = 'xul'
# Excluded for various symbol conflicts
signaling_non_unified_sources = [
'signaling/src/common/browser_logging/CSFLog.cpp',
'signaling/src/jsep/JsepSessionImpl.cpp',
'signaling/src/media-conduit/AudioConduit.cpp',
'signaling/src/media-conduit/MediaCodecVideoCodec.cpp',
'signaling/src/media-conduit/VideoConduit.cpp',
'signaling/src/media-conduit/WebrtcMediaCodecVP8VideoCodec.cpp',
'signaling/src/mediapipeline/MediaPipeline.cpp',
'signaling/src/mediapipeline/MediaPipelineFilter.cpp',
'signaling/src/mediapipeline/SrtpFlow.cpp',
'signaling/src/peerconnection/MediaPipelineFactory.cpp',
'signaling/src/peerconnection/MediaStreamList.cpp',
'signaling/src/peerconnection/PeerConnectionCtx.cpp',
'signaling/src/peerconnection/PeerConnectionImpl.cpp',
'signaling/src/peerconnection/PeerConnectionMedia.cpp',
'signaling/src/peerconnection/WebrtcGlobalInformation.cpp',
'signaling/src/sdp/sipcc/cpr_string.c',
'signaling/src/sdp/sipcc/sdp_access.c',
'signaling/src/sdp/sipcc/sdp_attr.c',
'signaling/src/sdp/sipcc/sdp_attr_access.c',
'signaling/src/sdp/sipcc/sdp_base64.c',
'signaling/src/sdp/sipcc/sdp_config.c',
'signaling/src/sdp/sipcc/sdp_main.c',
'signaling/src/sdp/sipcc/sdp_services_unix.c',
'signaling/src/sdp/sipcc/sdp_token.c',
'signaling/src/sdp/sipcc/sdp_utils.c',
]
GYP_DIRS['signaling'].non_unified_sources += signaling_non_unified_sources
GYP_DIRS += ['trunk/third_party/gflags']
GYP_DIRS['trunk/third_party/gflags'].input = 'trunk/third_party/gflags/gflags.gyp'
GYP_DIRS['trunk/third_party/gflags'].variables = gyp_vars_copy
GYP_DIRS['trunk/third_party/gflags'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
if CONFIG['_MSC_VER']:
# Avoid warnings from third-party code that we can not modify.
if CONFIG['CLANG_CL']:
CXXFLAGS += ['-Wno-invalid-source-encoding']
else:
CXXFLAGS += ['-validate-charset-']
if CONFIG['ENABLE_TESTS']:
TEST_DIRS += [
'signaling/fuzztest',
'signaling/gtest',
]