diff options
author | Ting-Wei Lan <lantw@src.gnome.org> | 2019-09-19 21:24:04 +0800 |
---|---|---|
committer | Ting-Wei Lan <lantw@src.gnome.org> | 2019-09-29 00:11:15 +0800 |
commit | 0390b673f11cc2834b6a04e1fc5e58e4cb24afcb (patch) | |
tree | 86e28fd355a32a9ccec58f481e5af58a6f606086 /mesonbuild/backend/ninjabackend.py | |
parent | 08ce1fb541374fb1ddce1d7318ceb92459942e9e (diff) | |
download | meson-0390b673f11cc2834b6a04e1fc5e58e4cb24afcb.zip meson-0390b673f11cc2834b6a04e1fc5e58e4cb24afcb.tar.gz meson-0390b673f11cc2834b6a04e1fc5e58e4cb24afcb.tar.bz2 |
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.
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 3 |
1 files changed, 1 insertions, 2 deletions
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')): |