[pygobject] setup.py: force GCC to use colors in case of stdout.isatty()



commit 773bb9de8cfc6dbcce88854e9cc35fc37ed1072e
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Thu Apr 12 09:28:20 2018 +0200

    setup.py: force GCC to use colors in case of stdout.isatty()

 setup.py | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/setup.py b/setup.py
index 74b5d5f3..90fea1ba 100755
--- a/setup.py
+++ b/setup.py
@@ -929,6 +929,10 @@ def add_ext_compiler_flags(ext, compiler, _cache={}):
             "-fvisibility=hidden",
         ]
 
+        # force GCC to use colors
+        if hasattr(sys.stdout, "isatty") and sys.stdout.isatty():
+            args.append("-fdiagnostics-color")
+
         _cache[cache_key] = filter_compiler_arguments(compiler, args)
 
     ext.extra_compile_args += _cache[cache_key]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]