Skip to content

Commit

Permalink
fixed ffi build for android. (#409)
Browse files Browse the repository at this point in the history
fixed ffi build for android.
  • Loading branch information
cloudwebrtc authored Nov 30, 2024
1 parent 9d68b19 commit 5a3a8ea
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ jobs:
target: aarch64-unknown-linux-gnu
- os: ubuntu-20.04
target: aarch64-linux-android
ndk_arch: aarch64-unknown-linux-musl
- os: ubuntu-20.04
target: armv7-linux-androideabi
ndk_arch: arm-unknown-linux-musleabihf
- os: ubuntu-20.04
target: x86_64-linux-android
ndk_arch: x86_64-unknown-linux-musl

name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -85,5 +88,6 @@ jobs:
- name: Build (Android)
if: ${{ contains(matrix.target, 'android') }}
run: |
ln -sf $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/${{ matrix.ndk_arch }}/{libunwind.so,libc++abi.a} $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/
cargo install cargo-ndk
cargo ndk --target ${{ matrix.target }} build --release -p livekit --workspace -vv
47 changes: 25 additions & 22 deletions .github/workflows/ffi-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,30 @@ jobs:
dylib: liblivekit_ffi.so
target: aarch64-unknown-linux-gnu
name: ffi-linux-arm64
## android builds broke
# - os: ubuntu-20.04
# platform: android
# dylib: liblivekit_ffi.so
# jar: libwebrtc.jar
# target: aarch64-linux-android
# name: ffi-android-arm64
# buildargs: --no-default-features --features "rustls-tls-webpki-roots"
# - os: ubuntu-20.04
# platform: android
# dylib: liblivekit_ffi.so
# jar: libwebrtc.jar
# target: armv7-linux-androideabi
# name: ffi-android-armv7
# buildargs: --no-default-features --features "rustls-tls-webpki-roots"
# - os: ubuntu-20.04
# platform: android
# dylib: liblivekit_ffi.so
# jar: libwebrtc.jar
# target: x86_64-linux-android
# name: ffi-android-x86_64
# buildargs: --no-default-features --features "rustls-tls-webpki-roots"
- os: ubuntu-20.04
platform: android
dylib: liblivekit_ffi.so
jar: libwebrtc.jar
target: aarch64-linux-android
ndk_arch: aarch64-unknown-linux-musl
name: ffi-android-arm64
buildargs: --no-default-features --features "rustls-tls-webpki-roots"
- os: ubuntu-20.04
platform: android
dylib: liblivekit_ffi.so
jar: libwebrtc.jar
target: armv7-linux-androideabi
ndk_arch: arm-unknown-linux-musleabihf
name: ffi-android-armv7
buildargs: --no-default-features --features "rustls-tls-webpki-roots"
- os: ubuntu-20.04
platform: android
dylib: liblivekit_ffi.so
jar: libwebrtc.jar
target: x86_64-linux-android
ndk_arch: x86_64-unknown-linux-musl
name: ffi-android-x86_64
buildargs: --no-default-features --features "rustls-tls-webpki-roots"

name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -157,6 +159,7 @@ jobs:
if: ${{ matrix.platform == 'android' }}
run: |
cd livekit-ffi/
ln -sf $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/${{ matrix.ndk_arch }}/{libunwind.so,libc++abi.a} $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/
cargo install cargo-ndk
cargo ndk --bindgen --target ${{ matrix.target }} build --release ${{ matrix.buildargs }}
Expand Down

0 comments on commit 5a3a8ea

Please sign in to comment.