Operating system specific files and search paths?

How to specify in Projucer, that some files should only be compiled in Windows or OSX and not in the other operating system?

How to specify operating system specific include file search paths so they are used only when compiling for that operating system?

Check the Exporters section in your Projucer project. There is an Extra Compiler Flags field there you can use as needed. And under the Configurations for each Exporter are things like Header Search Path and Preprocessor Definitions that you can set for controlling things like this. Your code can include an #if statement that lets you skip or include the following code in a particular file, or whether to #include a specific file or not, based on whether it’s Mac or Windows (or any other condition you specify).

Alternatively you can organize your code as JUCE modules.

A bit overkilling at first but time saver after (i hope).

1 Like

OK, thanks!

Would also be nice to have a feature in the upcoming Projucer which lets you choose per file basis if you want it to be compiled in some specific build or not (exporter). This would make it much more convenient when working on multiplatform software which must have platform specific files.