Preprocessor definitions for Standalone Plugins only [SOLVED]

Is there a way to set preprocessor definitions for only the “standalone” “vst3” etc. build targets?

Did you already have a look at A Format Only Code and Standalone vs VST defs?

No and no! Thanks and sorry for the duplicate quesiton :slight_smile:

Ok I have two followup questions:

  1. JUCEApplicationBase::isStandaloneApplication() seems to be not found by my compiler? Do I need to add a specific module or include anything?

  2. (only necessary if 1. cant be resolved) Where do I turn off the “shared code” option, so the defines dont get set all at once?

Thanks

You can check during runtime if your plugin is running as a standalone with your AudioProcessor’s wrapperType member. (Check if it’s set to wrapperType_Standalone.)

wrapperType member? Please elaborate! My processor seems to have no such member and a repo wide search for “wrapper” turned out blank.

It’s a member of the AudioProcessor base class in Juce itself.

1 Like

Ok that worked out!

Thank you both for your answers, much appreciated! :slight_smile:

Hmmm I just found this will always be true, even in VSTs for some reason… Am I doing this right?

m_is_standalone_plugin = (typeid(wrapperType) == typeid(wrapperType_Standalone));

Why are you using typeid? You should be comparing wrapperType with wrapperType_Standalone directly, i.e.

wrapperType == wrapperType_Standalone
1 Like

Ok now it works. I figured the WrapperTypes would be different subclasses to wrap the plugin, not literal type identifiers :smile:
Anyway thank you!