When does "Extra Compiler Flags" have an effect?


#1

I’ve put the following into “Extra Compiler Flags” for Visual Studio 2017:

/Oi /Oy /Ot /GF /GS- /fp:fast /fp:except- /Gr

I’ve tried both having them on one line separated by spaces, and as separate lines.

But whenever I click the symbol that starts up Visual Studio, the solution generated does not have any of these flags. I’ve re-saved, restarted and rebuilt multiple times without any sign that these are considered anywhere.

What am I missing?


#2

I just use /fp:fast and it appears all over the output window as

Command line warning D9025: overriding '/fp:precise' with '/fp:fast'

#3

Oh wait, you’re right. I see similar things too now:
“Command line error D8016: ‘/Gd’ and ‘/Gr’ command-line options are incompatible”
I have removed /Gr now.

The odd thing is that when i right-click the project and check the settings, I don’t see the options appear there. So I guess Visual Studio’s own settings are sort of colliding with what’s being inserted by Juce because it just specifies these in the “Additional Options” text input field instead of using the dedicated properties in the projects.

Maybe if Juce specified the settings in each project directly (rather than using “Additional Options”), the changes would appear directly in the various property pages, and I wouldn’t get this “collission”.

But I dunno if that’s possible. And maybe I should just leave the settings at whatever defaults Juce sets up. I’m not even 100% certain if these compiler/linker flags are sane after all.


#4

The additional options should just be appended to the command-line options when compiling. What issues are you seeing?


#5

I’ll rephrase then…

Basically, each project in Visual Studio has a “Properties” section where you use the menus to pick various compiler and linker settings, and these are then turned into a list of compiler/linker flags.

Juce should populate these settings in the project files that it outputs.

Instead it appends these settings as a string of various flags using the “Extra Compiler Flags”, and these flags will then be in conflict with the project file that Juce has generated.

Basically, Juce sets up a project that says “do this”, and then adds the Extra Compiler Flags to say “no wait, do this instead!”


#6

Certain flags can be set in the exporter and build configuration settings in the Projucer e.g. optimisation, warning level etc. The extra compiler flags field allows you to specify other flags that aren’t covered by these options, as the Projucer can’t be expected to have a one-to-one mapping for every VS setting.


#7

That makes sense. I’ll just stick to the flags that can be overwritten, then. Thanks.