aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-05-22 19:24:59 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2016-05-22 19:24:59 +0300
commit1a0938cc250d6202ffb099fba40b58fb5880c90c (patch)
tree8a839c455c98eafe2c2aa5d38f2d1143be94ed94 /mesonbuild/backend/ninjabackend.py
parent1574471822f8a034b33cb79f5e18f2c597a7dec5 (diff)
downloadmeson-1a0938cc250d6202ffb099fba40b58fb5880c90c.zip
meson-1a0938cc250d6202ffb099fba40b58fb5880c90c.tar.gz
meson-1a0938cc250d6202ffb099fba40b58fb5880c90c.tar.bz2
Automagic scan-build support.
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r--mesonbuild/backend/ninjabackend.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index c299a5c..73fd389 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -188,6 +188,7 @@ int dummy;
outfile.write('# Coverage rules\n\n')
self.generate_coverage_rules(outfile)
outfile.write('# Suffix\n\n')
+ self.generate_utils(outfile)
self.generate_ending(outfile)
# Only ovewrite the old build file after the new one has been
# fully created.
@@ -1797,6 +1798,16 @@ rule FORTRAN_DEP_HACK
other_deps.append(outfilename)
return (src_deps, other_deps)
+ # For things like scan-build and other helper tools we might have.
+ def generate_utils(self, outfile):
+ cmd = [sys.executable, self.environment.get_build_command(),
+ '--internal', 'scanbuild', self.environment.source_dir, self.environment.build_dir,
+ sys.executable, self.environment.get_build_command()]
+ elem = NinjaBuildElement(self.all_outputs, 'scan-build', 'CUSTOM_COMMAND', 'PHONY')
+ elem.add_item('COMMAND', cmd)
+ elem.add_item('pool', 'console')
+ elem.write(outfile)
+
def generate_ending(self, outfile):
targetlist = [self.get_target_filename(t) for t in self.build.get_targets().values()\
if not isinstance(t, build.RunTarget)]