diff --git a/.github/workflows/publish-libaec.yml b/.github/workflows/publish-libaec.yml index 9c4b933..25ad784 100644 --- a/.github/workflows/publish-libaec.yml +++ b/.github/workflows/publish-libaec.yml @@ -40,6 +40,12 @@ jobs: archive: "tar" target: "x86_64-unknown-linux-gnu" + - platform: "ubuntu-22.04" # riscv64 + args: "--target riscv64gc-unknown-linux-gnu" + build-dir: "libaec-riscv64gc-unknown-linux-gnu" + archive: "tar" + target: "riscv64gc-unknown-linux-gnu" + - platform: "macos-latest" # Linux arm64 args: "" build-dir: "libaec-android-aarch64" @@ -81,6 +87,13 @@ jobs: echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV if: matrix.target == 'aarch64-unknown-linux-gnu' + - name: Install riscv64 toolchain + run: | + sudo apt update + sudo apt install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libc6-dev-riscv64-cross + echo "RUSTFLAGS=-C linker=riscv64-linux-gnu-gcc" >> $GITHUB_ENV + if: matrix.target == 'riscv64gc-unknown-linux-gnu' + - name: Setup Android NDK uses: nttld/setup-ndk@v1 id: setup-ndk diff --git a/README.md b/README.md index 8516375..de35f8e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Acoustic echo cancellation in Rust based on [speexdsp](https://github.com/xiph/s - 🦀 Rust and 🐍 Python support - 🔗 Easy integration with C/C++ (or any other language) via C API - 📦 Precompiled library and C header files available in the [releases](https://github.com/thewh1teagle/aec-rs/releases/latest) -- 🖥️ Support for Windows (x86/arm64), Linux (x86/arm64), macOS (x86/arm64), Android (arm64), IOS (arm64), and WASM! +- 🖥️ Support for Windows (x86/arm64), Linux (x86/arm64), macOS (x86/arm64), Android (arm64), IOS (arm64), WASM, and Riscv64! - 🖥️ Run on Raspberry PI as well # Install diff --git a/crates/aec-rs-sys/build.rs b/crates/aec-rs-sys/build.rs index 54ca3f6..9d5b590 100644 --- a/crates/aec-rs-sys/build.rs +++ b/crates/aec-rs-sys/build.rs @@ -41,6 +41,10 @@ fn main() { if target.contains("android") { clang_target = "armv8-linux-androideabi".to_string(); } + if target.contains("riscv64gc-unknown-linux-gnu") { + // https://github.com/rust-lang/rust-bindgen/issues/2136 + clang_target = "riscv64-unknown-linux-gnu".to_string(); + } let mut bindings = bindgen::Builder::default().header("wrapper.h");