Skip to content

thomasfanell/webrtc-objc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

webrtc-objc

WebRTC binary package store for Apple platforms

Official documentation: https://webrtc.googlesource.com/src/+/main/docs/native-code/ios/

Manually building WebRTC

Install prerequisites

depot_tools

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

Once cloned, add depot_tools to the front of your PATH environment variable:

export PATH=<path/to/depot_tools>:$PATH

depot_tools provides commands such as gn, fetch etc. which are needed to clone, configure and build WebRTC.

Clone WebRTC

  1. Create a directory for the WebRTC source and enter it
  2. Run: fetch --nohooks webrtc_ios && gclient sync

Build

  1. Enter the src directory
  2. Create a build output directory, e.g. out
  3. Generate the build tree:
# Note: Assuming 'out/' exists here...
gn gen out/ --args='target_os="ios" target_cpu="arm64" target_environment="device" is_debug=false ios_enable_code_signing=false rtc_include_tests=false rtc_enable_objc_symbol_export=true' --ide=xcode

Now build the WebRTC framework: ninja -C out/ framework_objc

Note: We're only building for ios/arm64 here. If you need other variants, repeat this step for each (using a different build output directory for each one) and adapt the XC framework generation command below to include the other frameworks.

Creating a XC framework

  1. Navigate to the build output directory and run: xcodebuild -create-xcframework -framework WebRTC.framework -output WebRTC.xcframework
  2. Zip it: zip -r WebRTC.xcframework.zip WebRTC.xcframework
  3. Generate checksum: shasum -a 256 WebRTC.xcframework.zip and make a note of it. This checksum should be included in the release info, and is later referenced by your Package.swift file when defining the WebRTC target.

Example usage

// Package.swift

.binaryTarget(
    name: "WebRTC",
    url: "https://github.com/vidhance/webrtc-objc/releases/download/114.0.2/WebRTC.xcframework.zip",
    checksum: "c284debac479f1307ab53cd828b19276d525a07d6635e717f29056e5f4bd0ddf"
),

About

WebRTC package for Apple platforms.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors