Thanks Vinnie. Your first request is no problem, but am unclear about why you want all the module headers to have that JUCE_AMALGAMATED_INCLUDE test? Surely you’ll be setting that value to 1, so that would mean that none of these files would be processed at all…?
No actually its right, because those #ifdefs are meant for sanity checking not multiple-inclusion supression:
#if defined(__JUCE_CORE_JUCEHEADER__) && !defined (JUCE_AMALGAMATED_INCLUDE)
/* When you add this cpp file to your project, you mustn't include it in a file where you've
already included any other headers - just put it inside a file on its own, possibly with your config
flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
header files that the compiler may be using.
*/
#error "Incorrect use of JUCE cpp file"
#endif
#if defined(__JUCE_CORE_JUCEHEADER__) && !defined (JUCE_AMALGAMATED_INCLUDE)
/* When you add this cpp file to your project, you mustn't include it in a file where you've
already included any other headers - just put it inside a file on its own, possibly with your config
flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
header files that the compiler may be using.
*/
#error "Incorrect use of JUCE cpp file"
#endif
…because that would break all the normal builds.
And if I just add this:
#if defined (__JUCE_CORE_JUCEHEADER__) && !defined (JUCE_AMALGAMATED_INCLUDE)
#if defined (__JUCE_DATA_STRUCTURES_JUCEHEADER__) && ! JUCE_AMALGAMATED_INCLUDE
Where it should read:
#if defined (__JUCE_DATA_STRUCTURES_JUCEHEADER__) && ! defined(JUCE_AMALGAMATED_INCLUDE)
Not sure how this compiled for you. Unlike the AppConfig.h switches, which are always defined [0,1], “JUCE_AMALGAMATED_INCLUDE” is either defined or undefined depending on whether the amalgamation is being built.
Yes, I was getting a compile error but it was because I was defining the macro without a particular value. I picked up the latest tip, fixed my macro definition, rebuilt the amalgamation and now it compiles without modification. Hooray!
How do you feel about this amalgamated form of Juce?
Well it works now so those should be the only changes, until an include line breaks it. Can we make this official? Is it possible to incorporate this into the distribution?
Is this code for generating an amalgamation from juce v2 in any publicly accessible repository? I’m trying to convert a VisualStudio project that was set-up to use juce v1 with amalgamations to use juce v2 with the modules, and it’s turning out to be a big pain in the ass. And I think it would be easier to use amalgamations for this.
Yes. The amalgamation tool, the templates used to produce the Juce amalgamation (and FreeType), the Juce and FreeType amalgamations, and the 1.52 Juce amalgamation used to compile the tool are here: