Skip to content

Commit

Permalink
tools: add ability to build WebRTC with bitcode
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed May 3, 2019
1 parent d798310 commit 5e3e466
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions tools/build-webrtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def build_gn_args(platform_args):

_GN_IOS_ARGS = [
'enable_dsyms=true',
'enable_ios_bitcode=false',
'enable_ios_bitcode=%s',
'ios_deployment_target="9.0"',
'ios_enable_code_signing=false',
'target_os="ios"',
Expand Down Expand Up @@ -105,7 +105,7 @@ def setup(target_dir, platform):
sh('./build/install-build-deps.sh')


def build(target_dir, platform, debug):
def build(target_dir, platform, debug, bitcode):
build_dir = os.path.join(target_dir, 'build', platform)
build_type = 'Debug' if debug else 'Release'
depot_tools_dir = os.path.join(target_dir, 'depot_tools')
Expand Down Expand Up @@ -138,7 +138,7 @@ def build(target_dir, platform, debug):
if platform == 'ios':
for arch in IOS_BUILD_ARCHS:
gn_out_dir = 'out/%s-%s' % (build_type, arch)
gn_args = GN_IOS_ARGS % (str(debug).lower(), arch)
gn_args = GN_IOS_ARGS % (str(debug).lower(), arch, str(bitcode).lower())
gn_cmd = 'gn gen %s %s' % (gn_out_dir, gn_args)
sh(gn_cmd, env)
else:
Expand Down Expand Up @@ -202,6 +202,7 @@ def build(target_dir, platform, debug):
parser.add_argument('--ios', help='Use iOS as the target platform', action='store_true')
parser.add_argument('--android', help='Use Android as the target platform', action='store_true')
parser.add_argument('--debug', help='Make a Debug build (defaults to false)', action='store_true')
parser.add_argument('--bitcode', help='Enable bitcode (defaults to false)', action='store_true')

args = parser.parse_args()

Expand Down Expand Up @@ -234,7 +235,7 @@ def build(target_dir, platform, debug):
sys.exit(0)

if args.build:
build(target_dir, platform, args.debug)
build(target_dir, platform, args.debug, args.bitcode)
print('WebRTC build for %s completed in %s' % (platform, target_dir))
sys.exit(0)

4 changes: 2 additions & 2 deletions tools/downloadBitcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -euo pipefail

# Files to be downloaded
WEBRTC_FRAMEWORK="https://dl.bintray.com/saghul/react-native-webrtc/M69-1/WebRTC.framework.tar.xz"
WEBRTC_DSYM="https://dl.bintray.com/saghul/react-native-webrtc/M69-1/WebRTC.dSYM.tar.xz"
WEBRTC_FRAMEWORK="https://dl.bintray.com/webrtc-builds/webrtc-builds/M69-1/WebRTC.framework.tar.xz"
WEBRTC_DSYM="https://dl.bintray.com/webrtc-builds/webrtc-builds/M69-1/WebRTC.dSYM.tar.xz"


THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
Expand Down

0 comments on commit 5e3e466

Please sign in to comment.