Skip to content

Commit 3ffa1a9

Browse files
authored
Remove Explicit Deletion of CMake /GR Flag as 3.20's *CMP0117* by Default Doesn't Add It (#96814)
* Remove /GR flag as new CMake Policy doesn't add it by default. * Tell CMake to use the new behavior of CMP0117. * CMake policy is by default set when not specified, so removing the explicit setting in CMakeLists.txt * Flag /GR- fix. * Restored accidentally deleted comment.
1 parent 15eb4df commit 3ffa1a9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

eng/native/configurecompiler.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -780,9 +780,7 @@ if (MSVC)
780780
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/GS>) # Explicitly enable the buffer security checks
781781
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/fp:precise>) # Enable precise floating point
782782

783-
# disable C++ RTTI
784-
# /GR is added by default by CMake, so remove it manually.
785-
string(REPLACE "/GR " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
783+
# Disable C++ RTTI
786784
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
787785

788786
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/FC>) # use full pathnames in diagnostics

0 commit comments

Comments
 (0)