From 99ba25d1bdd6495c0dd9f2179c94c7bbafde20c8 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 29 May 2022 14:54:28 +0200 Subject: [PATCH] Enable simd for the Crossover plugin --- plugins/crossover/Cargo.toml | 6 ++++++ plugins/crossover/README.md | 6 +++--- plugins/crossover/src/lib.rs | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/crossover/Cargo.toml b/plugins/crossover/Cargo.toml index bcfd963a..b7efa382 100644 --- a/plugins/crossover/Cargo.toml +++ b/plugins/crossover/Cargo.toml @@ -8,5 +8,11 @@ license = "GPL-3.0-or-later" [lib] crate-type = ["cdylib"] +[features] +default = ["simd"] +# Make it go fast, vroom. Requires a nightly compiler. Non-SIMD builds are +# currently unsupported. +simd = ["nih_plug/simd"] + [dependencies] nih_plug = { path = "../../", features = ["assert_process_allocs"] } diff --git a/plugins/crossover/README.md b/plugins/crossover/README.md index c18783f2..91fcb4c1 100644 --- a/plugins/crossover/README.md +++ b/plugins/crossover/README.md @@ -25,9 +25,9 @@ on macOS. ### Building -After installing [Rust](https://rustup.rs/), you can compile Crossover as -follows: +After installing **nightly** [Rust](https://rustup.rs/) toolchain, you can +compile Crossover as follows: ```shell -cargo xtask bundle crossover --release +cargo +nightly xtask bundle crossover --release ``` diff --git a/plugins/crossover/src/lib.rs b/plugins/crossover/src/lib.rs index 812475e2..3ffba6e0 100644 --- a/plugins/crossover/src/lib.rs +++ b/plugins/crossover/src/lib.rs @@ -14,6 +14,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#![cfg_attr(feature = "simd", feature(portable_simd))] + +#[cfg(not(feature = "simd"))] +compile_error!("Compiling without SIMD support is currently not supported"); + use nih_plug::prelude::*; use std::sync::Arc;