BUILD_WEBRTC.md 3.8 KB

Build WebRTC

1. Prerequisites

  git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  • At least 30 GB of free disk space

  • Matching macOS and Xcode version (see Versions)

2a. Setup Fresh Build

  1. Set path to depot tools (if not in your default path)
   export PATH=/path/to/depot_tools:$PATH
  1. Choose and set WebRTC and patch commit to use (see Versions below)
   export COMMIT=commit_id
   export PATCH_COMMIT=patch_commit_id
   
   # e.g.
   # export COMMIT=963cc1ef1336b52ca27742beb28bfbc211ed54d0
   # export PATCH_COMMIT=a57784d2f12b566cd79cd771d65b49a078841cca
  1. Create a new folder and go into it
   mkdir WebRTC-build
   cd WebRTC-build
  1. Fetch a regular WebRTC checkout with the iOS-specific parts added. (This might take a while...)
   fetch --nohooks webrtc_ios
  1. Get patches
   git clone https://github.com/threema-ch/webrtc-build-docker.git
   cd webrtc-build-docker

(The patches are part of our WebRTC PeerConnection Build Script.)

2b. Setup Rebuild

  1. Set path to depot tools (if not in your default path)
   export PATH=/path/to/depot_tools:$PATH
  1. Choose and set WebRTC and patch commit to use (see Versions below)
   export COMMIT=commit_id
   export PATCH_COMMIT=patch_commit_id
  1. Reset applied patches
   cd WebRTC-build/src
   git reset --hard
  1. Update patches
   cd ../webrtc-build-docker
   git checkout master && git pull origin master

3. Checkout and Apply Patches

  1. Check out patch commit
   git checkout $PATCH_COMMIT
  1. Go into src folder and checkout WebRTC. (This might take a while...)
   cd ../src
   git checkout master && git pull && git checkout $COMMIT && gclient sync
  1. Apply patches
   for i in ../webrtc-build-docker/build/patches/*.patch; do patch -p1 < $i; done

4. Build

You can either build for release or debug. Debug is needed for the simulator.

Build for release

  1. Build
   tools_webrtc/ios/build_ios_libs.py --bitcode --arch arm64 arm --output-dir ../out
  1. Remove existing framework and move to correct location
   rm -r ../../WebRTC-release
   mkdir ../../WebRTC-release
   mv ../out/WebRTC.framework ../../WebRTC-release

Build for debug

  1. Build
   tools_webrtc/ios/build_ios_libs.py --bitcode --arch arm64 arm x64 x86 --output-dir ../out
  1. Remove existing framework and move to correct location
   rm -r ../../WebRTC-debug
   mkdir ../../WebRTC-debug
   mv ../out/WebRTC.framework ../../WebRTC-debug

5. Include in App Build

To ensure this version will be used in the app build, remove the existing chosen WebRTC build.

rm -r ../../WebRTC

Versions

iOS App Version WebRTC Commit Patch Commit macOS Version Xcode Version WebRTC Binary Version
4.6.3 (2587) 963cc1ef1336b52ca27742beb28bfbc211ed54d0 (m84) a57784d2f12b566cd79cd771d65b49a078841cca 10.15.5 (19F101) 11.5 (11E608c) 84.1.1