From b6219be0e49fb61c71910aef72c597b7248cedb6 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sun, 3 Dec 2023 20:33:16 +0100 Subject: [PATCH] CMake: fix cxx flag check Oops... Fixes #2224 --- src/CMakeLists.template.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.template.cmake b/src/CMakeLists.template.cmake index 320997b2ed..f7f492b67e 100644 --- a/src/CMakeLists.template.cmake +++ b/src/CMakeLists.template.cmake @@ -14,13 +14,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) +set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable -Werror) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) endif() foreach(flag ${MY_CXX_FLAGS}) unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(-Werror ${flag} CUR_FLAG_SUPPORTED) + check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) if(${CUR_FLAG_SUPPORTED}) string(APPEND CMAKE_CXX_FLAGS " ${flag}") endif()