From 3989146fa5a121ec765fc5cab809795057f00124 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Fri, 6 Jan 2023 16:58:52 +0000 Subject: [PATCH] build: enable severe warnings for MSVC release Enable severe warnings for MSVC release builds with /W1. Disable macro redefinition warnings explicitly with /wd4005. Signed-off-by: Rafael Kitover --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8da1d2f..c54ad568 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -814,7 +814,9 @@ elseif(MSVC) add_compiler_flags(${runtime} /ZI /W4 /Ob0 /Od /RTC1 /DDEBUG /EHsc) else() - add_compiler_flags(/w /DNDEBUG /EHsc) + # Enable severe warnings for release builds, but suppress macro + # redefinition warnings. + add_compiler_flags(/W1 /wd4005 /DNDEBUG /EHsc) if(CMAKE_BUILD_TYPE STREQUAL Release) if(X86_32)