feat: make VST3 an opt-in cargo feature

Cargo.toml declared Apache-2.0 while the default build linked vst3-sys,
whose bindings are GPLv3 — so the artifact a fresh clone produced could
not legally be distributed under the licence the repo claimed. A template
should not hand that trap to every project cloned from it.

NIH-plug already anticipates this: its `vst3` feature exists, in upstream's
own words, "mostly for GPL-compliance reasons". Taking `default-features =
false` and re-exporting `vst3` as a local opt-in makes the default build
CLAP-only and genuinely Apache-2.0 clean, while `--features vst3` remains
one flag away for anyone who accepts GPLv3.

Gating the feature rather than relicensing keeps the decision with whoever
uses the template. Reversing it is a one-line default plus removing two
cfg attributes, where relicensing to GPLv3 now would commit every
downstream plugin to that choice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
This commit is contained in:
2026-08-29 10:24:33 +09:00
parent fc45d3eec0
commit c6f2f32fb3
3 changed files with 40 additions and 14 deletions
+2
View File
@@ -133,6 +133,7 @@ impl ClapPlugin for MyPlugin {
const CLAP_FEATURES: &'static [ClapFeature] = &[ClapFeature::AudioEffect];
}
#[cfg(feature = "vst3")]
impl Vst3Plugin for MyPlugin {
// TODO: Replace with a unique 16-byte Class ID.
// Must be exactly 16 bytes — padded with '!' if shorter.
@@ -141,4 +142,5 @@ impl Vst3Plugin for MyPlugin {
}
nih_export_clap!(MyPlugin);
#[cfg(feature = "vst3")]
nih_export_vst3!(MyPlugin);