Introjucer: Specify Compile option based on platform

It seems there is no way to indicate whether or not a file should be compiled based on the platform. For example, I have .cpp files that I want compiled only for Visual Studio targets and not Macintosh:


I would like the .cpp to be compiled only for non OS X / iOS targets, and the .mm to be compiled only for OS X / iOS targets.

It’d be a logistical nightmare to have exporter-specific settings like that for every file, and to maintain them all when exporters are added/removed.

What I normally do is something like:

#define JUCE_IS_INSIDE_MM 1 #include "foo.cpp"


#if JUCE_IS_INSIDE_MM || defined (_WIN32) ...the code..

Yeah I ended up doing this as a workaround to prevent the amalgamated .cpp from causing compile errors in the Macintosh project:


#if !defined(__APPLE__) || defined(__OBJC__)