From 0390b673f11cc2834b6a04e1fc5e58e4cb24afcb Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Thu, 19 Sep 2019 21:24:04 +0800 Subject: Find clang-format with alternative names This is similar to what we currently do for scan-build except there is no environment variable to choose a specific clang-format to run. If an environment variable is needed for better control, we can add it later. --- mesonbuild/backend/ninjabackend.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mesonbuild/backend') diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 8315ab1..c960727 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2657,9 +2657,8 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) self.create_target_alias('meson-scan-build') def generate_clangformat(self): - import shutil target_name = 'clang-format' - if shutil.which('clang-format') is None: + if not environment.detect_clangformat(): return if not os.path.exists(os.path.join(self.environment.source_dir, '.clang-format')) and \ not os.path.exists(os.path.join(self.environment.source_dir, '_clang-format')): -- cgit v1.1