-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a workflow to build cross platform libs
Removed the manually compiles shared objects Updated src.cmake to suit
- Loading branch information
1 parent
6009fc2
commit 6571a82
Showing
6 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Build Cross-Platform Libraries | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
target: aarch64-apple-darwin | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: windows-latest | ||
target: x86_64-pc-windows-gnu | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Download DeepFilterNet | ||
run: git clone --depth 1 https://github.com/Rikorose/DeepFilterNet.git DeepFilterNet | ||
|
||
- name: Install Rust Targets | ||
run: rustup target add ${{ matrix.target }} | ||
|
||
- name: Install Dependencies (macOS) | ||
if: matrix.os == 'macos-latest' | ||
run: brew install zig | ||
|
||
- name: Build libdf for macOS (Universal Binary) | ||
if: matrix.os == 'macos-latest' | ||
env: | ||
RUSTFLAGS: "-C linker=zig cc -C link-arg=-target -C link-arg=aarch64-apple-darwin" | ||
run: | | ||
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) | ||
export MACOSX_DEPLOYMENT_TARGET=11.0 | ||
cargo build --manifest-path=DeepFilterNet/Cargo.toml --release --features capi --target aarch64-apple-darwin -Z build-std | ||
cargo build --manifest-path=DeepFilterNet/Cargo.toml --release --features capi --target x86_64-apple-darwin | ||
mkdir -p MediaProcessor/lib | ||
lipo -create -output MediaProcessor/lib/libdf.dylib \ | ||
target/aarch64-apple-darwin/release/libdf.dylib \ | ||
target/x86_64-apple-darwin/release/libdf.dylib | ||
- name: Build libdf for Linux | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
cargo build --manifest-path=DeepFilterNet/Cargo.toml --release --features capi --target x86_64-unknown-linux-gnu | ||
mkdir -p MediaProcessor/lib | ||
mv target/x86_64-unknown-linux-gnu/release/libdf.so MediaProcessor/lib/libdf.so | ||
- name: Build libdf for Windows | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
cargo build --manifest-path=DeepFilterNet/Cargo.toml --release --features capi --target x86_64-pc-windows-gnu | ||
mkdir -p MediaProcessor/lib | ||
mv target/x86_64-pc-windows-gnu/release/libdf.dll MediaProcessor/lib/libdf.dll | ||
mv target/x86_64-pc-windows-gnu/release/libdf.dll.a MediaProcessor/lib/libdf.dll.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.