From 7811d4288d91f0c15d834982ffdc6adfbeecc4a0 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 19 Jun 2022 00:17:45 -0700 Subject: chore(meson): optionalize clang-tidy --- .gitignore | 3 +++ meson.build | 24 +++++++++++++----------- meson_options.txt | 4 ++++ 3 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 meson_options.txt diff --git a/.gitignore b/.gitignore index a265be2..301b324 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ CMakeLists.txt # Meson build* + +# clangd +.cache diff --git a/meson.build b/meson.build index 91356b4..029cde4 100644 --- a/meson.build +++ b/meson.build @@ -57,14 +57,16 @@ run_target('format', project_header_files, ]) -run_target('tidy', - command : [ - 'run-clang-tidy', - # '-fix', - '-j', - '8', - 'files', - '.', # '^((?!(fuwn)).)*$', - '-format', - '-p=' + meson.build_root() - ]) +if get_option('tidy') + run_target('tidy', + command : [ + 'run-clang-tidy', + # '-fix', + '-j', + '8', + 'files', + '.', # '^((?!(fuwn)).)*$', + '-format', + '-p=' + meson.build_root() + ]) +endif diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..161c91b --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,4 @@ +option('tidy', + type : 'boolean', + value : false, + description : 'Enables the clang-tidy target') -- cgit v1.2.3