From 83c5bdc95f575b5db293f87ebbe1bcc461a2bfc4 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 9 Apr 2020 05:38:12 +0100 Subject: [PATCH] windows: msvc toolchain warnings to errors This may cause some dust to start with since there are many versions of msvc in use out there. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 726b3daf7..e64473f37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1773,6 +1773,11 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG) endif() endif () +if (MSVC) + # Fail the build if any warnings + add_compile_options(/W3 /WX) +endif() + if (LWS_PLAT_OPTEE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot ../../../../lib/libutils/isoc/include -I../../../../lib/libutils/isoc/include -I../../../../lib/libutils/ext/include" ) endif()