aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
authorGabriel Ganne <gabriel.ganne@mindmaze.com>2019-09-09 09:15:38 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2019-09-14 05:51:36 +0300
commite7197895b27a789a4339b493ceddb242f7f12c9e (patch)
treed2c687fbd181bea66a60706f31b345279ff69839 /mesonbuild/backend/ninjabackend.py
parent9e04450eb694c91dcb097a388c7bf4ecc7290545 (diff)
downloadmeson-e7197895b27a789a4339b493ceddb242f7f12c9e.zip
meson-e7197895b27a789a4339b493ceddb242f7f12c9e.tar.gz
meson-e7197895b27a789a4339b493ceddb242f7f12c9e.tar.bz2
uniform scan-build detection process
Detect scan-build the same way when trying to launch it and when generating the target. The detection method is: 1. look within SCANBUILD env variable 2. shutil.which('scan-build') 3. *on non-linux platforms only*: go through all the possible name candidates and test them individually. The third step is added following this comment https://github.com/mesonbuild/meson/pull/5857#issuecomment-528305788 However, going through a list of all the possible candidates is neither easily maintainable nor performant, and is therefore skipped on platforms that should not require such a step (currently, only Linux platforms). This is a follow-up to the issue raised by @lantw44 during PR: https://github.com/mesonbuild/meson/pull/5857
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r--mesonbuild/backend/ninjabackend.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 17b4986..fc88896 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2646,8 +2646,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
self.create_target_alias('meson-dist')
def generate_scanbuild(self):
- import shutil
- if shutil.which('scan-build') is None:
+ if not environment.detect_scanbuild():
return
cmd = self.environment.get_build_command() + \
['--internal', 'scanbuild', self.environment.source_dir, self.environment.build_dir] + \