diff options
Diffstat (limited to 'libbuild2/cc')
-rw-r--r-- | libbuild2/cc/buildfile | 2 | ||||
-rw-r--r-- | libbuild2/cc/common.cxx | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/libbuild2/cc/buildfile b/libbuild2/cc/buildfile index 7dcd811..654d0a4 100644 --- a/libbuild2/cc/buildfile +++ b/libbuild2/cc/buildfile @@ -11,7 +11,7 @@ libpkgconf = $config.build2.libpkgconf if $libpkgconf import impl_libs += libpkgconf%lib{pkgconf} else - import impl_libs += libpkg-config%lib{pkg-config} + import impl_libs += libbutl%lib{butl-pkg-config} include ../bin/ intf_libs = ../bin/lib{build2-bin} diff --git a/libbuild2/cc/common.cxx b/libbuild2/cc/common.cxx index 2a8bc50..9a4a07c 100644 --- a/libbuild2/cc/common.cxx +++ b/libbuild2/cc/common.cxx @@ -1691,6 +1691,10 @@ namespace build2 // Note that clang-cl appears to use -fansi-escape-codes. See GH // issue #312 for background. // + // Note that MSVC ignores /diagnostics:color if diagnostics is + // written to a pipe. See GH issue #312 for details and a link to + // the MSVC bug report. + // if (show_diag_color ()) { if (cvariant.empty () && @@ -1716,7 +1720,8 @@ namespace build2 // // Supported from GCC 4.9 (8.1 on Windows) and (at least) from Clang // 3.5. Clang supports -f[no]color-diagnostics in addition to the - // GCC's spelling. + // GCC's spelling. Note that to enable color on Windows Clang also + // needs -fansi-escape-codes. // if ( #ifndef _WIN32 @@ -1742,7 +1747,14 @@ namespace build2 show_diag_color () ? "-fdiagnostics-color" : stderr_term ? "-fno-diagnostics-color" : nullptr)) + { args.push_back (o); + +#ifdef _WIN32 + if (ctype == compiler_type::clang && o[2] != 'n') + args.push_back ("-fansi-escape-codes"); +#endif + } } } |