ninjabackend: do not generate scan-build target if it cannnot be run
as what was done with clang-format, test the presence of the tool before
generating a dedicated target. Pass silently if scan-build is not found.
@@ -2640,6 +2640,9 @@ 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:
+ return
cmd = self.environment.get_build_command() + \
['--internal', 'scanbuild', self.environment.source_dir, self.environment.build_dir] + \
self.environment.get_build_command() + self.get_user_option_args()
