File-Specific Complier Flags

Hi Jules & Team!

 

I've hit a bit of a problem with the Jucer overwriting some settings in Visual Studio.

I need to set some file-specific Command Line Additional Options which are just getting removed whenever the IntroJucer resaves the project.

Any chance of adding support for this to the IntroJucer? It would drastically speed up my build times!!

 

Thanks,

Luke.

Sorry, as we've discussed on here many times, it'd just be too much of a technical pain for us to attempt to sync with changes that you've made directly in an IDE. If you want to suggest modifications to the Introjucer that would generate the extra project settings that you need, then that's something we'd be open to.

Syncing with IDE changes really would be a pain! The ability to add those settings in the IntroJucer was actually what I meant in the original post..

I can take a look at the IntroJucer code and see if I can make the changes myself.

I second this feature request. Not syncing with VS, but rather being able to add a flag to individual files.

For instance, we have a third-party .rc file in our Windows projects. Every time we save a project with Introjucer, we need to remember to find the file, right-click, select properties, and change "Item Type" to "Resource Compiler". It would save a lot of time and prevent absent-minded accidents if Introjucer supported this.

If you know what the change looks like in the relevent config files, its worth having a go at putting this into Introjucer yourself and sending a patch to the JUCE team. I've done this in recent past for certain Android settings. Have a look in the Project Saving folder for the relevant file and code.

Are file-specific compiler flags still not possible in Juce? We have a couple sources that require different optimization flags and can’t seem to find a suitable workaround.

I had the same issue when playing with the fast-math compiler flags since I was using sqlite and it specifically wouldn’t work with that optimisation. I ended up putting sqlite in separate static lib, and since sqlite is quite big it improved build times too. I know that may not help for your use case but if it’s parts of the codebase that change infrequently it may be useful.

Thanks! That’s helpful. It might not be ideal since debugging will be tougher but seems like a workable option.

Bumping this request again. We have a 3rd party library, that we don’t have control over, added into Projucer as Source Code. We want to disable warnings for these specific files by adding in -W flags. Please add file specific compiler flags into Projucer, at least for XCode and VS.

There seem to be many useful application cases.

Thanks!

You could always include all the 3rd party files in your own file and use pragmas to turn warnings off. This is done in some JUCE code which includes other libs. Grep for #pragma warning (disable.

This can be difficult however if the warnings are in headers as some flags can’t be turned back on once disabled…

Thanks, I know JUCE includes cpp files a lot for its modules, but including cpp files seems like the wrong approach for the actual project. I would need to manually disable compiling these library cpp files in the projucer and then include them into one common cpp file, that seems not like the right approach.

You could also turn off compiler warnings globally for the whole project, but if you have a global header file which all your own files include, you could add pragmas in there to turn on all the warnings you want for your own stuff.