From cea7292c877dc05d6659c4052bc4ed21eb77ce79 Mon Sep 17 00:00:00 2001 From: FeignClaims Date: Wed, 23 Oct 2024 08:00:13 +0800 Subject: [PATCH] fix: correct message level for cppcheck fallback standard We provide no way to explicitly and separately (without changing `CMAKE__STANDARD`) specify what standard cppcheck should use. Therefore, when cppcheck fallbacking to use the default standard, the corresponding cmake message should be `STATUS` instead of `${WARNING_MESSAGE}` which fails the compilation when `WARNINGS_AS_ERRORS`. --- src/StaticAnalyzers.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/StaticAnalyzers.cmake b/src/StaticAnalyzers.cmake index 5041adf3..666397bc 100644 --- a/src/StaticAnalyzers.cmake +++ b/src/StaticAnalyzers.cmake @@ -42,7 +42,7 @@ macro(enable_cppcheck CPPCHECK_OPTIONS) set(CMAKE_CXX_CPPCHECK ${CMAKE_CXX_CPPCHECK} --std=c++${CMAKE_CXX_STANDARD}) else() message( - ${WARNING_MESSAGE} + STATUS "cppcheck doesn't support specified C++ standard ${CMAKE_CXX_STANDARD}. Using the cppcheck default C++ standard version." ) endif() @@ -54,8 +54,8 @@ macro(enable_cppcheck CPPCHECK_OPTIONS) elseif(CMAKE_C_STANDARD MATCHES [[99|11]]) set(CMAKE_C_CPPCHECK ${CMAKE_C_CPPCHECK} --std=c${CMAKE_C_STANDARD}) else() - message(${WARNING_MESSAGE} - "cppcheck doesn't support C ${CMAKE_C_STANDARD} standard. Using the cppcheck default" + message(STATUS + "cppcheck doesn't support C ${CMAKE_C_STANDARD} standard. Using the cppcheck default C standard version" ) endif() endif()