From c4d03f01546119c4cf01743a63138519d10e2202 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 9 May 2019 15:49:27 -0400 Subject: [PATCH] CMakeLists: Specify /volatile:iso for MSVC By default, MSVC doesn't use standards-compliant volatile semantics. This makes it behave in a standards-compliant manner, making expectations more uniform across compilers. --- src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a1d87bbbcd..7c7be31db6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,6 +27,7 @@ if (MSVC) # /Zo - Enhanced debug info for optimized builds # /permissive- - Enables stricter C++ standards conformance checks # /EHsc - C++-only exception handling semantics + # /volatile:iso - Use strict standards-compliant volatile semantics. # /Zc:externConstexpr - Allow extern constexpr variables to have external linkage, like the standard mandates # /Zc:inline - Let codegen omit inline functions in object files # /Zc:throwingNew - Let codegen assume `operator new` (without std::nothrow) will never return null @@ -38,6 +39,7 @@ if (MSVC) /permissive- /EHsc /std:c++latest + /volatile:iso /Zc:externConstexpr /Zc:inline /Zc:throwingNew