From 0d3375fc222a050cf853d3ab18dfe5d614332834 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 4 May 2019 00:29:54 -0400 Subject: [PATCH] CMakeLists: Add /Zc:externConstexpr compilation flag Improves standard conformance on Windows builds. --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ce8ddc3..ce9a9d2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules") # Compiler flags if (MSVC) set(DYNARMIC_CXX_FLAGS - /std:c++latest # CMAKE_CXX_STANDARD as no effect on MSVC until CMake 3.10. + /std:c++latest # CMAKE_CXX_STANDARD has no effect on MSVC until CMake 3.10. /W4 /w34263 # Non-virtual member function hides base class virtual function /w44265 # Class has virtual functions, but destructor is not virtual @@ -55,8 +55,9 @@ if (MSVC) /Zi /Zo /EHsc - /Zc:throwingNew # Assumes new never returns null - /Zc:inline # Omits inline functions from object-file output + /Zc:externConstexpr # Allows external linkage for variables declared "extern constexpr", as the standard permits. + /Zc:inline # Omits inline functions from object-file output. + /Zc:throwingNew # Assumes new (without std::nothrow) never returns null. /DNOMINMAX) if (DYNARMIC_WARNINGS_AS_ERRORS)