Projucer, Xcode Macros and Escaping

So I’ve started implementing AAX PageTables on our plug-ins.
In order to use it you must have a define and make sure you add the file to your Resources*.
(might be worth handling this nicer for Win/Mac & AAX but that’s another story…)

When I define:
JucePlugin_AAXPageTableFile=“PluginNameAAXPageTable.xml”

  • Xcode, this WON’T work! the quotes being used by Xcode itself.
  • VS2015, works as expected.

When I define:
JucePlugin_AAXPageTableFile=“PluginNameAAXPageTable.xml”

  • Xcode Yells since it actually breaks the xcode-xml file…

When I define:
JucePlugin_AAXPageTableFile=\“PluginNameAAXPageTable.xml\”
(I’ve edited this as discourse escaped me :slight_smile: )

  • It works for Xcode! yay!
  • It’s broken for VS :frowning:

Summary:
For now I need to DoRY instead of DRY.

Might be nice to fix this…

1 Like

We’ll have a look at this.

Do you want the definition of JucePlugin_AAXPageTableFile to include the surrounding “”?

@t0m I didn’t find any documentation of JucePlugin_AAXPageTableFile

However looking at the code and testing shows the following:

  1. The actual use of JucePlugin_AAXPageTableFile is to a const char* which is the filename to be used for mapping…
    So… just as JUCE plug-in name #define is quoted this also must be quoted.
  2. You also need to add it to .aaxplugin/Contents/Resources
    (btw, with current JUCE separate plug-in builds this isn’t trivial. You add Resources in Projucer, but which show up on ALL targets. might be nice adding AAXPageTable to the projucer settings as a filename/path value)
2 Likes

I’ve pushed a fix for this to develop. The following should now work on OS X too:

JucePlugin_AAXPageTableFile="PluginNameAAXPageTable.xml"
1 Like

Hi @t0m,
Well… close enough :wink: Xcode needs escaping so the export for Xcode should be:
JucePlugin_AAXPageTableFile="\PluginNameAAXPageTable.xml\"

:frowning:
In order to avoid multiple defines for each platform…

Does this escaping still work? I was trying to add a page table for a plugin and I ended up having to have a definition like:

JucePlugin_AAXPageTableFile="\"PluginNameAAXPageTable.xml\""

…to get it to compile (but doesn’t work for runtime). My solution right now is to write the definition into the user section of AppConfig.h:

#define JucePlugin_AAXPageTableFile "PluginNameAAXPageTable.xml"

The problem with writing to the AppConfig.h file is that that is not under source control for us, since it’s in the JuceLibraryCode folder that gets generated, and we don’t want all that stuff in source control when it can all be generated. Perhaps we need to add just that file?

Yes, we used to exclude specifically AppConfig.h file from the gitignore, just for the UserSection

**/.DS_Store
Builds
JuceLibraryCode
!JuceLibraryCode/AppData.h
2 Likes

That’s IMHO not the elegant solution. as @HowardAntares mentioned,
it’s a generated file… if it’s not resolved by current JUCE builds then it should be addressed. I’ll see on Sunday what’s going on, our releases still uses JUCE 4.3.x IIRC, but I’ll see if 5.x got this regressed as it seems to be working for us.

This still seems to be broken as of JUCE 6.1.2. Is the best solution still modifying AppConfig.h?

It works on SR’s branch, if that helps…

1 Like

Please can you describe exactly what is not working for you?

I just tried adding JucePlugin_AAXPageTableFile="PluginNameAAXPageTable.xml" to the global Preprocessor Definitions field of a Projucer plugin project, and then building it on both Xcode and VS2019. In both cases, static_assert (false, JucePlugin_AAXPageTableFile) in the source code prints PluginNameAAXPageTable.xml as I would expect.

Looks like this works if the filename has no spaces, but Xcode fails with The project is damaged and cannot be opened due to a parse error otherwise.

That’s an easy enough fix for us, though it’d be great to have the option of a preprocessor macro string with spaces.

1 Like

Thanks, I’ll investigate.

2 Likes

It looks to me like this is working as intended. The help text for the Preprocessor Definitions field says

to include a space or a comma in a definition, precede it with a backslash

Accordingly, specifying JucePlugin_AAXPageTableFile="Plugin\ Name\ AAXPageTable.xml" in the Projucer results in the definition of a quoted string that includes spaces.

2 Likes

Ah, I see. Sorry! That’s our mistake.

1 Like