Skip to content

Commit 101b0e0

Browse files
committed
Build: Enable more msvc standard conformance options
(cherry picked from commit c5425196fd5bd04ce22aad377959e7f4376cafb1)
1 parent d03e90e commit 101b0e0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cmake/compiler/msvc/settings.cmake

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,12 @@ if((PLATFORM EQUAL 64) OR (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.2302
6565
endif()
6666

6767
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
68-
# /Zc:throwingNew.
69-
# When you specify Zc:throwingNew on the command line, it instructs the compiler to assume
70-
# that the program will eventually be linked with a conforming operator new implementation,
71-
# and can omit all of these extra null checks from your program.
72-
# http://blogs.msdn.com/b/vcblog/archive/2015/08/06/new-in-vs-2015-zc-throwingnew.aspx
7368
target_compile_options(trinity-compile-option-interface
7469
INTERFACE
75-
/Zc:throwingNew)
70+
/Zc:__cplusplus # Enable updated __cplusplus macro value
71+
/Zc:preprocessor # Enable preprocessor conformance mode
72+
/Zc:templateScope # Check template parameter shadowing
73+
/Zc:throwingNew) # Assume operator new throws
7674
endif()
7775

7876
# Define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES - eliminates the warning by changing the strcpy call to strcpy_s, which prevents buffer overruns

0 commit comments

Comments
 (0)