Skip to content

Commit cea7292

Browse files
committed
fix: correct message level for cppcheck fallback standard
We provide no way to explicitly and separately (without changing `CMAKE_<LANG>_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`.
1 parent b98498e commit cea7292

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/StaticAnalyzers.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ macro(enable_cppcheck CPPCHECK_OPTIONS)
4242
set(CMAKE_CXX_CPPCHECK ${CMAKE_CXX_CPPCHECK} --std=c++${CMAKE_CXX_STANDARD})
4343
else()
4444
message(
45-
${WARNING_MESSAGE}
45+
STATUS
4646
"cppcheck doesn't support specified C++ standard ${CMAKE_CXX_STANDARD}. Using the cppcheck default C++ standard version."
4747
)
4848
endif()
@@ -54,8 +54,8 @@ macro(enable_cppcheck CPPCHECK_OPTIONS)
5454
elseif(CMAKE_C_STANDARD MATCHES [[99|11]])
5555
set(CMAKE_C_CPPCHECK ${CMAKE_C_CPPCHECK} --std=c${CMAKE_C_STANDARD})
5656
else()
57-
message(${WARNING_MESSAGE}
58-
"cppcheck doesn't support C ${CMAKE_C_STANDARD} standard. Using the cppcheck default"
57+
message(STATUS
58+
"cppcheck doesn't support C ${CMAKE_C_STANDARD} standard. Using the cppcheck default C standard version"
5959
)
6060
endif()
6161
endif()

0 commit comments

Comments
 (0)