aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-07-07 18:59:15 +0200
committerShauren <shauren.trinity@gmail.com>2025-08-30 22:55:25 +0200
commit101b0e07413899af9ba6c78b701daaca867e7cff (patch)
tree67f05d1998f1eac410278c3ce6c63ba036e7c20f /cmake
parentd03e90ef43b24f5fc2078fb8939b5f89d458c558 (diff)
Build: Enable more msvc standard conformance options
(cherry picked from commit c5425196fd5bd04ce22aad377959e7f4376cafb1)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/compiler/msvc/settings.cmake10
1 files changed, 4 insertions, 6 deletions
diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake
index 094bb2bacc0..b71d7e9e808 100644
--- a/cmake/compiler/msvc/settings.cmake
+++ b/cmake/compiler/msvc/settings.cmake
@@ -65,14 +65,12 @@ if((PLATFORM EQUAL 64) OR (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.2302
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
- # /Zc:throwingNew.
- # When you specify Zc:throwingNew on the command line, it instructs the compiler to assume
- # that the program will eventually be linked with a conforming operator new implementation,
- # and can omit all of these extra null checks from your program.
- # http://blogs.msdn.com/b/vcblog/archive/2015/08/06/new-in-vs-2015-zc-throwingnew.aspx
target_compile_options(trinity-compile-option-interface
INTERFACE
- /Zc:throwingNew)
+ /Zc:__cplusplus # Enable updated __cplusplus macro value
+ /Zc:preprocessor # Enable preprocessor conformance mode
+ /Zc:templateScope # Check template parameter shadowing
+ /Zc:throwingNew) # Assume operator new throws
endif()
# Define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES - eliminates the warning by changing the strcpy call to strcpy_s, which prevents buffer overruns