From 8e2f0f588e21ff835f87688c4df543ec6545f33d Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Wed, 1 Dec 2021 16:03:22 +0100 Subject: cmake: add configure option 'ENABLE_WERROR' to keep in sync with autotools --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ba1a397..3b57e4e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,6 +233,8 @@ endif() string(APPEND CMAKE_C_FLAGS " -fno-common") string(APPEND CMAKE_CXX_FLAGS " -fno-common") +option(ENABLE_WERROR "Unconditionally make all compiler warnings fatal" OFF) + if(MSVC) # Use the highest warning level if(WALL) @@ -331,6 +333,9 @@ else() ) set(WARNINGS_ERRORS ) + if(ENABLE_WERROR) + list(APPEND WARNINGS error) + endif() endif() generate_compiler_warning_flags( -- cgit v1.2.1