summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build21
1 files changed, 21 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 32c79d4..15fb371 100644
--- a/meson.build
+++ b/meson.build
@@ -15,6 +15,7 @@ project(
)
patchage_src_root = meson.current_source_dir()
+patchage_build_root = meson.current_build_dir()
major_version = meson.project_version().split('.')[0]
version_suffix = '@0@-@1@'.format(meson.project_name(), major_version)
@@ -267,6 +268,26 @@ if get_option('lint')
suite: 'data',
)
endif
+
+ # Check code with cppcheck
+ cppcheck = find_program('cppcheck', required: false)
+ if cppcheck.found()
+ compdb_path = join_paths(patchage_build_root, 'compile_commands.json')
+ suppress_path = join_paths(patchage_src_root, '.suppress.cppcheck')
+ test(
+ 'cppcheck',
+ cppcheck,
+ args: [
+ '--enable=warning,style,performance,portability',
+ '--error-exitcode=1',
+ '--project=' + compdb_path,
+ '--suppressions-list=' + suppress_path,
+ '-q',
+ ],
+ suite: 'code',
+ timeout: 60,
+ )
+ endif
endif
# Check licensing metadata