From b9c8edb657d79093714bc87aec49db40f4aefa0c Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Thu, 18 Apr 2019 00:28:23 -0700 Subject: [PATCH] Allow clang to colorize output in ninja --- scripts/parse_syms.py | 10 ++++++++++ scripts/templates/build.ninja.j2 | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 scripts/parse_syms.py diff --git a/scripts/parse_syms.py b/scripts/parse_syms.py new file mode 100755 index 0000000..7f19f55 --- /dev/null +++ b/scripts/parse_syms.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +def parse_elf(filename): + import struct + with open(filename, 'rb') as elf: + +if __name__ == "__main__": + import sys + for arg in sys.argv[1:]: + parse_elf(arg) diff --git a/scripts/templates/build.ninja.j2 b/scripts/templates/build.ninja.j2 index c79276b..26444ff 100644 --- a/scripts/templates/build.ninja.j2 +++ b/scripts/templates/build.ninja.j2 @@ -4,7 +4,8 @@ {{ super() }} ccflags = $ccflags $ -I${srcroot}/src/include $ - -I${srcroot}/src/include/x86_64 + -I${srcroot}/src/include/x86_64 $ + -fcolor-diagnostics {% endblock %} {% block baserules %}