VS2022 compiler optimization flags in Projucer

Does anybody know how to configure the Projucer so that it loads a project in Visual Studio 2022 with all optimizations set for maximum code execution speed?
My code runs fastest when my VS2022 optimizations look like this (using Clang):

I am able to control the top “Optimization” setting via the “Optimisation” setting in Projucer/Exporters/VS2022/Release. I’ve tried putting additional flags in the “configuration-specific compiler flags” field in Projucer (as pictured below), but this doesn’t seem to affect my VS2022 project settings. So at present, I’m manually configuring these settings every time I reload a project from the Projucer.

I haven’t profiled the missing five settings individually, but collectively they make a significant performance impact. Fiber-Safe Optimizations I suspect may go unused by Clang, as I get a compiler warning (“argument unused during compilation: /GT”) with it activated.

Have you checked if your compiler flags in Projucer end up in the Visual Studio section C/C++ > Command Line? (under Additional Options)

I am pretty sure that your settings will be correctly passed to the compiler. I think the confusion comes from the other tabs not displaying what you enter via these Additional Options.

For example, my /arch:AVX option is not reflected in the Code Generation tab, but it is passed to the compiler.

Thank you!!

Yes, the flags I enter in the Projucer do indeed show up in VS2022/Properties/C++/Command Line, despite not being reflected in the actual “Optimizations” settings panel in VS2022.

I’m having a little trouble profiling the performance impact right now, but I’m 90% confident in your solution because I can make the above-mentioned /GT warning from Clang appear or disappear by adding/removing the /GT flag in Projucer.

Much appreciated.

Cool!