From f4afd3922e4541f5b9cc8b965e437712a1cb9727 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 16 Oct 2023 14:05:48 +0200 Subject: [PATCH] [cmake] readd NMake warning reset --- cmake/CompilerFlags.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake index d85853e3b..26437ef70 100644 --- a/cmake/CompilerFlags.cmake +++ b/cmake/CompilerFlags.cmake @@ -14,6 +14,18 @@ option(ENABLE_WARNING_ERROR "enable -Werror for compile" OFF) if (ENABLE_WARNING_VERBOSE) if (MSVC) + # Remove previous warning definitions, + # NMake is otherwise complaining. + foreach (flags_var_to_scrub + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS_MINSIZEREL) + string (REGEX REPLACE "(^| )[/-]W[ ]*[1-9]" " " + "${flags_var_to_scrub}" "${${flags_var_to_scrub}}") + endforeach() + set(C_WARNING_FLAGS /Wall )