Skip to content

MSVC: Do not add /GR to CMAKE_CXX_FLAGS by default

Brad King requested to merge brad.king/cmake:msvc-no-GR into master

The /GR flag has been on by default since MSVC cl 14.0 from VS 2005. Remove it from the default flags to make it easier for projects to pass /GR- themselves to turn it off.

Projects may be using string processing to replace /GR with another flag, so we cannot simply drop it. Add a policy to drop it in a compatible way.

Fixes: #21428 (closed)

Merge request reports