Skip to content

Commit 38fee58

Browse files
committed
split export macro into separate export macros for each plugin format
1 parent bc6390c commit 38fee58

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ clap-wrapper = { git = "https://github.com/blepfx/clap-wrapper-rs" }
2626

2727
Then, in your `lib.rs`:
2828
```rust
29-
clap_wrapper::export!();
29+
// exports `GetPluginFactoryAUV2` symbol if CLAP_WRAPPER_AUV2_SDK env variable is present
30+
clap_wrapper::export_auv2!();
31+
// exports `GetPluginFactory` symbol and extra VST3 symbols if CLAP_WRAPPER_VST3_SDK env variable is present
32+
clap_wrapper::export_vst3!();
3033
```
3134

3235
This will export VST3 and AUv2 entrypoints that use the `clap_entry` symbol exported from your crate (as an example, `nih_plug::nih_export_clap` exports it).

examples/example-clack/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,5 @@ pub struct PolySynthPluginMainThread<'a> {
232232
impl<'a> PluginMainThread<'a, PolySynthPluginShared> for PolySynthPluginMainThread<'a> {}
233233

234234
clack_export_entry!(SinglePluginEntry<PolySynthPlugin>);
235-
clap_wrapper::export!();
235+
clap_wrapper::export_auv2!();
236+
clap_wrapper::export_vst3!();

examples/example-nih-plug/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,5 @@ impl Vst3Plugin for Gain {
176176
}
177177

178178
nih_export_clap!(Gain);
179-
clap_wrapper::export!();
179+
clap_wrapper::export_auv2!();
180+
clap_wrapper::export_vst3!();

src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ pub mod auv2;
1919
pub mod auv2 {}
2020

2121
#[macro_export]
22-
macro_rules! export {
22+
macro_rules! export_auv2 {
2323
() => {
2424
#[allow(unused_imports)]
2525
pub use $crate::auv2::*;
26+
};
27+
}
28+
29+
#[macro_export]
30+
macro_rules! export_vst3 {
31+
() => {
2632
#[allow(unused_imports)]
2733
pub use $crate::vst3::*;
2834
};

0 commit comments

Comments
 (0)