[Request] Per File Warning Suppression

Hey JUCE team,

Perhaps this is an issue I alone face, but one struggle I have when using Projucer is the fact that it clears my per file compiler flags.

The main issue for myself is I add a -w flag to files which are 3rd party libraries generating warnings. This is quite nice because I don’t want to dig around too much in those files and I like to make certain my own source files have no warnings.

Is it possible that we could have a suppress warnings checkbox or a per file compile flag options added in Projucer? Has anyone else faced challenges like this?

Currently, whenever I rebuild the project with Projucer I need to go to each source file and re-add the compiler flags.




+1 for this

See Projucer individual file compiler settings feature request.

1 Like

Ohh shoot i missed that apologies! thanks Martin!

In the meantime maybe a pragma warning ignore in the inserted code (or in a wrapper cpp) is an option:

#pragma GCC diagnostic ignored "-Wall"
1 Like

You’re the shit Daniel thank you!

Had no idea about this, hoping it works : )



The #pragma wouldn’t work for me in XCode 9.2, only adding -w to the compiler flags, so I thought I’ll go and add it myself to the Projucer.
For some reason most of the code already exists to inhibit warnings on a per file basis, but the checkbox isn’t available!

That branch is up to date with master of the base JUCE repo, but I added the checkbox. :smile:
Only tested on macOS, but it works perfectly.

Well, it can only work on macOS (looking at the current JUCE master), because the only place where Project::Item::shouldInhibitWarnings() is used is in the Xcode exporter:

Ah, OK I saw that in there and didn’t look any further!