diff options
| author | fumingwei <[email protected]> | 2023-03-23 12:56:03 +0800 |
|---|---|---|
| committer | fumingwei <[email protected]> | 2023-03-23 13:19:34 +0800 |
| commit | 08a8907cdb1f7537d95ee144f947a743e2ae697d (patch) | |
| tree | bafe8ec995c59b0e4604986dbf97ce97f1078950 /CMakeLists.txt | |
| parent | 1b3d40eaa3db4867d71b0908f6121f1f21b8b448 (diff) | |
feature:1.新增执行测试用例执行流程2.新增cppcheck执行流程
Diffstat (limited to 'CMakeLists.txt')
| -rwxr-xr-x | CMakeLists.txt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 78df60d..8caa3cf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,37 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "/opt/MESA" CACHE PATH "default install path" FORCE) endif() +find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck) +if (CMAKE_CXX_CPPCHECK) + list( + APPEND CMAKE_CXX_CPPCHECK + "--enable=all" + "--error-exitcode=1" + "--suppress=unreachableCode" + "--suppress=unusedFunction" + "--suppress=missingInclude" + "--suppress=uselessAssignmentPtrArg" + "--suppress=unmatchedSuppression" + "--suppress=internalAstError" + "--suppress=unmatchedSuppression" + "--suppress=unreadVariable" + "--suppress=memleakOnRealloc" + "--suppress=redundantAssignment" + "--suppress=constParameter" + "--suppress=unsignedLessThanZero" + "--suppress=variableScope" + "--suppress=cstyleCast" + "--suppress=objectIndex" + "--suppress=shadowVariable" + "--suppress=nullPointerRedundantCheck" + "--suppress=ctunullpointer" + "--suppress=shadowFunction" + ) + set(CMAKE_C_CPPCHECK ${CMAKE_CXX_CPPCHECK}) +else() + message(FATAL_ERROR "Could not find the program cppcheck.") +endif() + #for ASAN set(ASAN_OPTION "OFF" CACHE STRING " set asan type chosen by the user, using OFF as default") set_property(CACHE ASAN_OPTION PROPERTY STRINGS OFF ADDRESS THREAD) |
