diff options
| author | chenzizhan <[email protected]> | 2023-07-27 15:49:27 +0800 |
|---|---|---|
| committer | chenzizhan <[email protected]> | 2023-07-27 15:49:27 +0800 |
| commit | 0b94063149e89acaf5cc8f2eba1a6c18702c264c (patch) | |
| tree | e51626674d58541c4267f1e450f9a3fd587bd611 | |
| parent | 0a728a0c4afa0ba8e9d5b970681d3128c5c70544 (diff) | |
fk cppcheck
| -rw-r--r-- | CMakeLists.txt | 83 |
1 files changed, 40 insertions, 43 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3996dd0..825903e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,11 +4,8 @@ message("-- CMAKE_C_COMPILER: ${CMAKE_C_COMPILER_ID}") set(lib_name fieldstat4)
-# include(FetchContent)
-# FetchContent_Declare(zlib
-# URL https://zlib.net/current/zlib.tar.gz
-# )
-# FetchContent_MakeAvailable(zlib)
+#the path where you install the cppcheck
+
project (${lib_name})
@@ -31,44 +28,44 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "/opt/MESA" CACHE PATH "default install path" FORCE)
endif()
-set(CPP_BIN_PATH "/home/chenzizhan/cppcheck/bin")
-find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck HINTS ${CPP_BIN_PATH})
-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"
- "--suppress=shiftTooManyBitsSigned"
- "--suppress=preprocessorErrorDirective"
- "--suppress=*:${PROJECT_SOURCE_DIR}/vendors/mpack/mpack.c"
- "--suppress=*:${PROJECT_SOURCE_DIR}/test/utils.hpp"
- "--suppress=*:${PROJECT_SOURCE_DIR}/test/unit_test_serialize.cpp"
- "--suppress=*:${PROJECT_SOURCE_DIR}/test/test_fuzz_test.cpp"
- # "--suppress=*:${PROJECT_SOURCE_DIR}/test/unit_test_fast_hash.cpp"
- )
- set(CMAKE_C_CPPCHECK ${CMAKE_CXX_CPPCHECK})
-else()
- message(FATAL_ERROR "Could not find the program cppcheck.")
-endif()
+# set(CPP_BIN_PATH "/home/chenzizhan/cppcheck/bin")
+# find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck HINTS ${CPP_BIN_PATH})
+# 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"
+# "--suppress=shiftTooManyBitsSigned"
+# "--suppress=preprocessorErrorDirective"
+# "--suppress=*:${PROJECT_SOURCE_DIR}/vendors/mpack/mpack.c"
+# "--suppress=*:${PROJECT_SOURCE_DIR}/test/utils.hpp"
+# "--suppress=*:${PROJECT_SOURCE_DIR}/test/unit_test_serialize.cpp"
+# "--suppress=*:${PROJECT_SOURCE_DIR}/test/test_fuzz_test.cpp"
+# # "--suppress=*:${PROJECT_SOURCE_DIR}/test/unit_test_fast_hash.cpp"
+# )
+# 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")
|
