Commit b8f1b43b authored by Tobias Hunger's avatar Tobias Hunger

Scripts: Add

Add a small python program to wrap ninja and split its output nicely
into stdout and stderr.

Change-Id: Ib2fae405c170ea15910de20d5f45aaab75aa89cb
Reviewed-by: Christian Stenger's avatarChristian Stenger <>
parent a570614f
'''A simple wrapper around ninja that enables Qt Creator to parse compile errors
This wrapper splits up ninja output in such a way that Qt Creator will be able
to extract compile errors from the output of this script.
Make sure that ninja is found in PATH and then override the make build step in
Qt Creator with this script to use it.
import os, subprocess, sys
def main():
stdout = os.fdopen(sys.stdout.fileno(), 'wb')
stderr = os.fdopen(sys.stderr.fileno(), 'wb')
proc = subprocess.Popen(['ninja'] + sys.argv[1:], stdout=subprocess.PIPE, bufsize=256)
for line in iter(proc.stdout.readline, b''):
if (line.startswith(b'[') or line.startswith(b'ninja: no work to do')) :
return proc.returncode
if __name__ == '__main__':
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment