summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 218e8400..fb59c10f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -20,6 +20,22 @@ if (HOS_MESA_LOG)
add_definitions(-DHOS_MESA_LOG)
endif()
+find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck)
+if (CMAKE_CXX_CPPCHECK)
+ list(
+ APPEND CMAKE_CXX_CPPCHECK
+ "--enable=all"
+ "--error-exitcode=1"
+ "--suppress=unusedFunction"
+ "--suppress=missingInclude"
+ "--suppress=uselessAssignmentPtrArg"
+ "--suppress=unmatchedSuppression"
+ )
+ set(CMAKE_C_CPPCHECK ${CMAKE_CXX_CPPCHECK})
+else()
+ message(FATAL_ERROR "Could not find the program cppcheck.")
+endif()
+
file(GLOB HOS_SRC
${HOS_SOURCE}
${HOS_HEADERS}