diff --git a/src/tint/BUILD.gn b/src/tint/BUILD.gn index d942b8688e..2167eaf8d3 100644 --- a/src/tint/BUILD.gn +++ b/src/tint/BUILD.gn @@ -628,8 +628,8 @@ libtint_source_set("libtint_core_all_src") { "writer/writer.h", ] - if (is_linux) { - sources += [ "diagnostic/printer_linux.cc" ] + if (is_linux || is_mac) { + sources += [ "diagnostic/printer_posix.cc" ] } else if (is_win) { sources += [ "diagnostic/printer_windows.cc" ] } else { diff --git a/src/tint/CMakeLists.txt b/src/tint/CMakeLists.txt index 7988364f5c..b30227a7e1 100644 --- a/src/tint/CMakeLists.txt +++ b/src/tint/CMakeLists.txt @@ -572,7 +572,7 @@ tint_generated(sem/parameter_usage) tint_generated(type/short_name BENCH TEST) if(UNIX) - list(APPEND TINT_LIB_SRCS diagnostic/printer_linux.cc) + list(APPEND TINT_LIB_SRCS diagnostic/printer_posix.cc) elseif(WIN32) list(APPEND TINT_LIB_SRCS diagnostic/printer_windows.cc) else() diff --git a/src/tint/diagnostic/printer_linux.cc b/src/tint/diagnostic/printer_posix.cc similarity index 94% rename from src/tint/diagnostic/printer_linux.cc rename to src/tint/diagnostic/printer_posix.cc index 56d77b9853..b854640513 100644 --- a/src/tint/diagnostic/printer_linux.cc +++ b/src/tint/diagnostic/printer_posix.cc @@ -42,9 +42,9 @@ bool supports_colors(FILE* f) { return true; } -class PrinterLinux : public Printer { +class PrinterPosix : public Printer { public: - PrinterLinux(FILE* f, bool colors) : file(f), use_colors(colors && supports_colors(f)) {} + PrinterPosix(FILE* f, bool colors) : file(f), use_colors(colors && supports_colors(f)) {} void write(const std::string& str, const Style& style) override { write_color(style.color, style.bold); @@ -91,7 +91,7 @@ class PrinterLinux : public Printer { } // namespace std::unique_ptr Printer::create(FILE* out, bool use_colors) { - return std::make_unique(out, use_colors); + return std::make_unique(out, use_colors); } } // namespace tint::diag