atilaneves / reggae

Build system in D, Python, Ruby, Javascript or Lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enable colored D compiler output with ninja backend

kinke opened this issue · comments

Ninja redirects stderr of launched processes (contrary to make apparently); both DMD and LDC react by not using ANSI color codes in their output. Reggae could implicitly enforce colors via -color=on (dmd/ldmd2) / -enable-color (ldc2). It does no harm because ninja takes care of stripping escape codes in case its stdout (seems to use stdout only) is redirected (can be overridden via env var CLICOLOR_FORCE=1). These ANSI color codes even work in Windows terminals of recent Win10 versions (ninja enables according flags).

Pretty sure this fixed it already: #147

Oh, I had no idea. :) - Well, sort-of - with make and a redirected stderr, you now enforce the escape codes in any case. Restricting it to ninja only would be perfect.

with make and a redirected stderr, you now enforce the escape codes in any case

Is that a big deal? Otherwise I have to pass in the backed to dcompile.

Definitely not for me, but some people might not want strange characters in some log file. AFAICT, you're appending the flag at the end, so that the user cannot override it via --dflags=-color=off.

I tried... this seems like way too much work for little benefit.