The /sdl flag forced C4996 to be treated as an error. I've set /w34996 to force it to be treated as a warning globally, and removed old pragmas that disabled it entirely.
This change more than doubles build speed for both clean and incremental builds. This could further improved by better managing pch.h contents and separating dependency compilation.
- Debug clean build: 75s to 32s (~2.3× faster)
- Debug incremental: 8s to 4s (2.0× faster)
- Release clean build: 84s to 38s (~2.2× faster)
- Release incremental: 40s to 18s (~2.2× faster)
Problems with previous setup:
- pch.h was misused as a general-purpose utility header and included from other headers.
- Precompiled headers were never actually enabled in the build configuration.
- Including a putative PCH from other headers violates two fundamental requirements:
1. A PCH must be the first #include in a translation unit to be effective.
2. Including PCH candidates in other headers defeats the optimization and triggers excessive rebuilds.
Changes:
- Relocated global utility declarations from pch.h to new SysUtils.h
- Replaced all #include "pch.h" occurrences in header files with #include "SysUtils.h"
- Headers no longer include pch.h under any circumstances
- Enabled /Yc (Create PCH) on pch.cpp and /Yu (Use PCH) on remaining .cpp files
- Excluded ImGui build from precompiled headers. Ideally this should be compiled as a separate, statically linked dependency, but this is a problem for another time.
- Added #include "pch.h" as the **very first** non-comment line in all .cpp translation units
Also a more aggressive hud detection for those inputs to combat the vignette if someone is using FSR FG inputs and somehow hasn't disabled the vignette.