From f64db80448564702925445be7a563dde3ecf5bab Mon Sep 17 00:00:00 2001 From: Carlos Gomes Martinho Date: Tue, 31 Mar 2020 14:43:44 +0200 Subject: [PATCH] build: do not treat compiler warnings as errors for unsafe builds with msvc this is the same behaviour as with gcc and clang Signed-off-by: Carlos Gomes Martinho --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e3098cd9..c5fd56233 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,7 +162,7 @@ if(CMAKE_COMPILER_IS_IAR) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts --warnings_are_errors -Ohz") endif(CMAKE_COMPILER_IS_IAR) -if(CMAKE_COMPILER_IS_MSVC) +if(CMAKE_COMPILER_IS_MSVC AND NOT UNSAFE_BUILD) # Strictest warnings, and treat as errors set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")