Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,6 @@ cargo build

```

### MacOS

When building on MacOS, `-ObjC` linker flag is needed. LiveKit's WebRTC implementation make use of ObjectiveC libraries on the Mac. You may get the following error if the app isn't linked with ObjC:

```
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RTCVideoCodecInfo nativeSdpVideoFormat]: unrecognized selector sent to instance 0x600003bc6660'
```

## Motivation and Design Goals

LiveKit aims to provide an open source, end-to-end WebRTC stack that works everywhere. We have two goals in mind with this SDK:
Expand Down
10 changes: 9 additions & 1 deletion webrtc-sys/libwebrtc/build_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,15 @@ ninja -C "$OUTPUT_DIR" :default \

# make libwebrtc.a
# don't include nasm
ar -rc "$ARTIFACTS_DIR/lib/libwebrtc.a" `find "$OUTPUT_DIR/obj" -name '*.o' -not -path "*/third_party/nasm/*"`
# Merge the sdk objects into a single archive member. The ObjC categories in
# sdk/objc (e.g. NSString+StdString) live in object files that export no
# symbols, so as individual members the linker never pulls them out of the
# archive and their methods are missing at runtime ("unrecognized selector")
# unless every consumer links with -ObjC. Merged into one member, they are
# loaded whenever any sdk symbol is referenced.
rm -f "$ARTIFACTS_DIR/lib/libwebrtc.a"
ld -r -keep_private_externs -o "$OUTPUT_DIR/sdk.o" `find "$OUTPUT_DIR/obj/sdk" -name '*.o'`
ar -rc "$ARTIFACTS_DIR/lib/libwebrtc.a" "$OUTPUT_DIR/sdk.o" `find "$OUTPUT_DIR/obj" -name '*.o' -not -path "*/third_party/nasm/*" -not -path "*/obj/sdk/*"`

# License generation - may fail locally due to GN warnings breaking JSON parsing
# Use vpython3 from depot_tools for consistent Python version
Expand Down
10 changes: 9 additions & 1 deletion webrtc-sys/libwebrtc/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,15 @@ ninja -C "$OUTPUT_DIR" :default \

# make libwebrtc.a
# don't include nasm
ar -rc "$ARTIFACTS_DIR/lib/libwebrtc.a" `find "$OUTPUT_DIR/obj" -name '*.o' -not -path "*/third_party/nasm/*"`
# Merge the sdk objects into a single archive member. The ObjC categories in
# sdk/objc (e.g. NSString+StdString) live in object files that export no
# symbols, so as individual members the linker never pulls them out of the
# archive and their methods are missing at runtime ("unrecognized selector")
# unless every consumer links with -ObjC. Merged into one member, they are
# loaded whenever any sdk symbol is referenced.
rm -f "$ARTIFACTS_DIR/lib/libwebrtc.a"
ld -r -keep_private_externs -o "$OUTPUT_DIR/sdk.o" `find "$OUTPUT_DIR/obj/sdk" -name '*.o'`
ar -rc "$ARTIFACTS_DIR/lib/libwebrtc.a" "$OUTPUT_DIR/sdk.o" `find "$OUTPUT_DIR/obj" -name '*.o' -not -path "*/third_party/nasm/*" -not -path "*/obj/sdk/*"`
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.

# License generation - may fail locally due to GN warnings breaking JSON parsing
# Use vpython3 from depot_tools for consistent Python version
Expand Down
Loading