Skip to content

Commit

Permalink
Bug 1393119 - Add webrtc gn build config; r=dminor
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: FIPjkDWwAQx

--HG--
extra : source : 5b4da712bf1e276dd5df44a1b23e2a715f5c19cb
  • Loading branch information
chmanchester committed Nov 29, 2017
1 parent 35ae458 commit 0a47308
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 13 deletions.
36 changes: 36 additions & 0 deletions build/gn.mozbuild
Original file line number Diff line number Diff line change
@@ -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'])
21 changes: 14 additions & 7 deletions media/webrtc/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -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 += [
Expand Down
11 changes: 5 additions & 6 deletions media/webrtc/trunk/gtest/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]

Expand Down
Empty file added media/webrtc/trunk/moz.build
Empty file.

0 comments on commit 0a47308

Please sign in to comment.