Bug 1393119 - Add webrtc gn build config; r=dminor

MozReview-Commit-ID: FIPjkDWwAQx

--HG--
extra : source : 5b4da712bf1e276dd5df44a1b23e2a715f5c19cb
This commit is contained in:
Chris Manchester 2017-11-29 11:18:44 -08:00
parent 35ae458bd1
commit 0a473080e6
4 changed files with 55 additions and 13 deletions

36
build/gn.mozbuild Normal file
View File

@ -0,0 +1,36 @@
# -*- 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/.
gn_vars = {}
if CONFIG['MOZ_DEBUG']:
gn_vars['is_debug'] = True
else:
gn_vars['is_debug'] = False
os = CONFIG['OS_TARGET']
flavors = {
'WINNT': 'win',
'Android': 'android',
'Linux': 'linux',
'Darwin': 'mac' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' else 'ios',
'SunOS': 'solaris',
'GNU/kFreeBSD': 'freebsd',
'DragonFly': 'dragonfly',
'FreeBSD': 'freebsd',
'NetBSD': 'netbsd',
'OpenBSD': 'openbsd',
}
gn_vars['target_os'] = flavors.get(os)
arches = {
'x86_64': 'x64',
'aarch64': 'arm64',
}
gn_vars['host_cpu'] = arches.get(CONFIG['HOST_CPU_ARCH'], CONFIG['HOST_CPU_ARCH'])
gn_vars['target_cpu'] = arches.get(CONFIG['CPU_ARCH'], CONFIG['CPU_ARCH'])

View File

@ -11,6 +11,7 @@ with Files("signaling/**"):
BUG_COMPONENT = ("Core", "WebRTC: Signaling")
include('/build/gyp.mozbuild')
include('/build/gn.mozbuild')
webrtc_non_unified_sources = [
'trunk/webrtc/common_audio/vad/vad_core.c', # Because of name clash in the kInitCheck variable
@ -56,8 +57,6 @@ webrtc_non_unified_sources = [
'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()
@ -68,12 +67,20 @@ elif CONFIG['MOZ_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
GN_DIRS += ['trunk']
gn_vars_copy = gn_vars.copy()
GN_DIRS['trunk'].variables = gn_vars_copy
GN_DIRS['trunk'].mozilla_flags = [
"-fobjc-arc",
"-mfpu=neon",
]
# We allow warnings for third-party code that can be updated from upstream.
GYP_DIRS['trunk'].sandbox_vars['COMPILE_FLAGS'] = {'WARNINGS_AS_ERRORS': []}
GYP_DIRS['trunk'].sandbox_vars['FINAL_LIBRARY'] = 'webrtc'
GYP_DIRS['trunk'].non_unified_sources += webrtc_non_unified_sources
GN_DIRS['trunk'].sandbox_vars['COMPILE_FLAGS'] = {'WARNINGS_AS_ERRORS': []}
GN_DIRS['trunk'].sandbox_vars['FINAL_LIBRARY'] = 'webrtc'
GN_DIRS['trunk'].non_unified_sources += webrtc_non_unified_sources
if CONFIG['MOZ_WEBRTC_SIGNALING']:
DIRS += [

View File

@ -34,12 +34,11 @@ USE_LIBS += [
'media_libopus',
'speex',
'webrtc',
'webrtc_common',
'webrtc_i420',
'webrtc_lib',
'webrtc_utility',
'webrtc_vp8',
'webrtc_vp9',
'webrtc_common_gn',
'webrtc_gn',
'webrtc_i420_gn',
'webrtc_vp8_gn',
'webrtc_vp9_gn',
'yuv',
]

View File