From 01eae8363e1f4111b426d120702c3e6bcef0f32c Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 24 Sep 2024 17:08:35 +0200 Subject: [PATCH] -pedantic-errors should not be enabled if warnings are not treated as errors --- cmake/TargetCompileWarnings.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/TargetCompileWarnings.cmake b/cmake/TargetCompileWarnings.cmake index 643e565..0512701 100644 --- a/cmake/TargetCompileWarnings.cmake +++ b/cmake/TargetCompileWarnings.cmake @@ -45,8 +45,8 @@ function(target_compile_warnings) elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") if(${_warnings_as_errors}) list(APPEND WARNINGS_COMPILE_OPTIONS "-Werror") + list(APPEND WARNINGS_COMPILE_OPTIONS "-pedantic-errors") endif() - list(APPEND WARNINGS_COMPILE_OPTIONS "-pedantic-errors") list(APPEND WARNINGS_COMPILE_OPTIONS "-Wall") list(APPEND WARNINGS_COMPILE_OPTIONS "-Wextra") list(APPEND WARNINGS_COMPILE_OPTIONS "-Wconversion")