VS: CMake should use the same default settings as current VS
After debugging for sometime why using cmake always generated inferior binaries than msbuild I realized cmake does not use the same default flags for Release profile (likely others too)
These should be improved upon otherwise we just continue to worsen the general user experience (be it developers or users of the final bins)
Missing in CMake generated msbuild (present in default c++ project generated by VS2022)
Safety:
- cl: /sdl (https://learn.microsoft.com/en-us/cpp/build/reference/sdl-enable-additional-security-checks)
Performance:
- cl: /Oi (https://learn.microsoft.com/en-us/cpp/build/reference/oi-generate-intrinsic-functions)
- cl: /GL (https://learn.microsoft.com/en-us/cpp/build/reference/gl-whole-program-optimization)
Development:
Greatly affect output binary size (removal of dead symbols):
- link: /OPT:REF (https://learn.microsoft.com/en-us/cpp/build/reference/opt-optimizations)
- link: /OPT:ICF (same url)