Weird query


#1

Okay, so the Amalgamated version of juce is super, and super useful. However, when it comes to debugging, it’s a bit of a pain in the bum-bum.

So, if i need to follow a bug into the depths of juce, it’s much easier to juce use the normal juce project.

Now, when i do this, i have to remove the juce_amalgamated.cpp file from my main project. I include juce via a custom JuceHeader.h file, which includes either juce.h or juce_amalgamated.h based on a macro define.

Ideally, I want to be able to change the juce method based on configuration [e.g. Debug, Release, Debug(amalgamated), Release(amalgamated)]. It’s easy enough to get the bulk of this idea working, but I can’t think of a way to exclude the juce_amalgamated.cpp file from a project based solely on settings.

The only thing i can think of is to just have ANOTHER project, which just contains the juce_amalgamated files. The configurations specify which project to use based on their linker/dependency settings.

Can anyone think of a simpler way of doing this?


#2

can’t you just wrap the entire amalgamated cpp file into a

#ifdef Debug(amalgamated) / #ifdef Release(amalgamated)

?

The cpp file will always be included, its contents will just be ignored though when the project type is set to debug, or release standard.

With VS you can do a lot of this kind of thing with multiple project configurations in one solution, but an #ifdef could be made to work on OSX and Linux too.


#3

Xcode targets can remove specific files from a target, I believe. It’s crappy UI though - whatever build target you have selected is what you’ll see in the target item - just add or remove files from there. They’ll stay in the main list.

Same for CodeBlocks I think. Can’t your windows IDE do the same? Or is it just non-obvious how to do it?

Bruce


#4

well, i looked and looked but couldn’t find a way.

valley, your tip is just FAR too obvious for me to have ever considered!


#5

I use an approach like valley’s - have a look inside juce_LibrarySource.cpp in the juce demo, where there’s a comment explaining what it’s doing.


#6

yeah, i don’t know why i didn’t think of that! :slight_smile: The thought of #include-ing a .cpp file never occurs to me - despite having waded through the windows juce code files over the last week and seeing it done plenty.

:oops: thanks guys :smiley: