Plugin format at compile time?

Hi all,

I’m wondering if there is a way to define a global pre-processor constant for a plugin project, but only when the a certain plugin format version of the plugin is being built (AAX in my case)?

I did see that there is project-global “Preprocessor definitions” field in the Projucer + also an “Extra preprocessor definitions” field for each exporter, but that won’t do the trick, as these are in effect for all plugin format versions.

Or is there already a preprocessor flag that’s being set by the Projucer for each build of a plugin format version that I could use?

(Background: we’re doing a simple checksum check on our plugin/applications to see if the files have been tampered with, but that conflicts with the signing done by the Pace tools, so I want to disable checksum checks in our code for AAX plugins.)

There are JucePlugin_Build_ flags for each type, but these will be set for all the plugins that are being built. The issue is that you are building the shared code once, and then only the wrapper code is being built for each format.

However, you can use PluginHostType::getPluginLoadedAs() to get the wrapper type at runtime and then don’t execute the checksum for AAX. Something like:

if (PluginHostType::getPluginLoadedAs() != AudioProcessor::wrapperType_AAX)
{
    // do checksum
}
1 Like

That was helpful, as I don’t have access to the AudioProcessor at that point.
Thanks Ed, also for the fast response!