diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2023-01-13 01:55:42 -0800 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2023-01-13 01:55:42 -0800 |
| commit | f2aed92fd1fb975ea4ac0011684c24f8b326be64 (patch) | |
| tree | ef874e0d3786a3c28b8bff2128097b4b58a5abda | |
| parent | 2a5c699489edaf55f3b54318cfaf3c69fbb2e622 (diff) | |
cmake: update msvc conformance flags
| -rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0686de846b..388fb13a6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -318,23 +318,13 @@ if(MSVC) add_compile_options(/Oi) # Enable buffer security check on Debug, disable otherwise add_compile_options($<IF:$<CONFIG:Debug>,/GS,/GS->) - # Enforce C++ standard conforming conversion rules to catch possible bugs - add_compile_options(/permissive-) # Remove unreferenced inline functions/data to reduce link time and catch bugs + # Note: In msbuild build, this gets set by msbuild by default add_compile_options(/Zc:inline) - # Assume `new` (w/o std::nothrow) throws to reduce binary size - add_compile_options(/Zc:throwingNew) + # Fix various other non-conformant behaviors + add_compile_options(/Zc:__cplusplus,enumTypes,externConstexpr,preprocessor,throwingNew) # Enforce strict volatile semantics as per ISO C++ add_compile_options(/volatile:iso) - # Fix non-conformant lambda behavior (constexpr variables shouldn't need capturing) - add_compile_options(/experimental:newLambdaProcessor) - # Fix various other non-conformant behaviors - add_compile_options(/Zc:__cplusplus,externConstexpr,lambda,preprocessor) - - # Temporarily disable warnings to enable /Zc:preprocessor compatibility with WinSDK headers. - add_compile_options( - /wd5105 # macro expansion producing 'defined' has undefined behavior - ) # Use 'precise' floating point model add_compile_options(/fp:precise) |
