From ffe626f5f3ba5797250f1243927bbd27f97e7a84 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Thu, 10 Oct 2019 12:31:12 +0100 Subject: [PATCH] Enable warnings when building. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 419cd5a8..6f753be8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,6 +117,12 @@ try_compile(HAVE_ATTR_UNUSED # Compiler flags +if (MSVC) + add_compile_options(/W4 /WX) +else() + add_compile_options(-Wall -Wextra) +endif() + # Check for include files check_include_file(assert.h HAVE_ASSERT_H) check_include_file(inttypes.h HAVE_INTTYPES_H)