summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-04-12 09:28:20 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2018-04-12 16:28:35 +0200
commit773bb9de8cfc6dbcce88854e9cc35fc37ed1072e (patch)
treef52ade5c9a373f43ff3e3f1ad708cc44adda0d78
parentb77f9fb8be61698814000aefff3c1f29609bf6c8 (diff)
downloadpygobject-773bb9de8cfc6dbcce88854e9cc35fc37ed1072e.tar.gz
setup.py: force GCC to use colors in case of stdout.isatty()
-rwxr-xr-xsetup.py4
1 files changed, 4 insertions, 0 deletions
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]