From 5893aea60250c0e55475fd53326a0929a8028c8a Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Sat, 29 Apr 2017 12:12:54 +0100 Subject: [PATCH] [CMake] When building with MSVC and without `WARNINGS_AS_ERRORS` pass `/WX-` to MSVC. Although this is not necessary this duplicates the behaviour of the old build system. --- contrib/cmake/cmake/compiler_warnings.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/cmake/cmake/compiler_warnings.cmake b/contrib/cmake/cmake/compiler_warnings.cmake index e49e43947..e02b28b2c 100644 --- a/contrib/cmake/cmake/compiler_warnings.cmake +++ b/contrib/cmake/cmake/compiler_warnings.cmake @@ -44,4 +44,11 @@ if (WARNINGS_AS_ERRORS) message(STATUS "Treating compiler warnings as errors") else() message(STATUS "Not treating compiler warnings as errors") + # FIXME: Remove "x.." when CMP0054 is set to NEW + if ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") + # Warnings as errors is off by default for MSVC so setting this + # is not necessary but this duplicates the behaviour of the old + # build system. + list(APPEND Z3_COMPONENT_CXX_FLAGS "/WX-") + endif() endif()