This fixes a problem when e.g. a configure test probes if the compiler
(wrapped via ccache) supports -fdiagnostics-color=auto. If ccache discards
the option since configure redirects stderr, then configure will
erroneously think that the compiler supports the option and the build will
fail later on (if stderr refers to a TTY).
/* Output is redirected, so color output must be forced. */
args_add(stripped_args, "-fdiagnostics-color=always");
cc_log("Automatically forcing colors");
+ } else {
+ args_add(stripped_args, argv[i]);
}
found_color_diagnostics = true;
continue;