@@ -34,39 +34,41 @@ class ANSI(Enum):
3434 internal value, or an empty string in a non-colorized scope.
3535 """
3636
37- GRAY = "\x1b [0;30m"
38- RED = "\x1b [0;31m"
39- GREEN = "\x1b [0;32m"
40- YELLOW = "\x1b [0;33m"
41- BLUE = "\x1b [0;34m"
42- PURPLE = "\x1b [0;35m"
43- CYAN = "\x1b [0;36m"
44- WHITE = "\x1b [0;37m"
45-
46- BOLD_GRAY = "\x1b [1;90m"
47- BOLD_RED = "\x1b [1;91m"
48- BOLD_GREEN = "\x1b [1;92m"
49- BOLD_YELLOW = "\x1b [1;93m"
50- BOLD_BLUE = "\x1b [1;94m"
51- BOLD_PURPLE = "\x1b [1;95m"
52- BOLD_CYAN = "\x1b [1;96m"
53- BOLD_WHITE = "\x1b [1;97m"
54-
5537 RESET = "\x1b [0m"
5638
57- def __str__ (self ):
39+ BOLD = "\x1b [1m"
40+ ITALIC = "\x1b [3m"
41+ UNDERLINE = "\x1b [4m"
42+ STRIKETHROUGH = "\x1b [9m"
43+ REGULAR = "\x1b [22;23;24;29m"
44+
45+ BLACK = "\x1b [30m"
46+ RED = "\x1b [31m"
47+ GREEN = "\x1b [32m"
48+ YELLOW = "\x1b [33m"
49+ BLUE = "\x1b [34m"
50+ MAGENTA = "\x1b [35m"
51+ CYAN = "\x1b [36m"
52+ WHITE = "\x1b [37m"
53+
54+ PURPLE = "\x1b [38;5;93m"
55+ PINK = "\x1b [38;5;206m"
56+ ORANGE = "\x1b [38;5;214m"
57+ GRAY = "\x1b [38;5;244m"
58+
59+ def __str__ (self ) -> str :
5860 global _colorize
59- return self .value if _colorize else ""
61+ return str ( self .value ) if _colorize else ""
6062
6163
6264def print_warning (* values : object ) -> None :
6365 """Prints a warning message with formatting."""
64- print (f"{ ANSI .BOLD_YELLOW } WARNING:{ ANSI .YELLOW } " , * values , ANSI .RESET , file = sys .stderr )
66+ print (f"{ ANSI .YELLOW } { ANSI . BOLD } WARNING:{ ANSI .REGULAR } " , * values , ANSI .RESET , file = sys .stderr )
6567
6668
6769def print_error (* values : object ) -> None :
6870 """Prints an error message with formatting."""
69- print (f"{ ANSI .BOLD_RED } ERROR:{ ANSI .RED } " , * values , ANSI .RESET , file = sys .stderr )
71+ print (f"{ ANSI .RED } { ANSI . BOLD } ERROR:{ ANSI .REGULAR } " , * values , ANSI .RESET , file = sys .stderr )
7072
7173
7274def add_source_files_orig (self , sources , files , allow_gen = False ):
@@ -647,33 +649,33 @@ def mySpawn(sh, escape, cmd, args, env):
647649
648650
649651def no_verbose (env ):
650- colors = [ANSI .BLUE , ANSI .BOLD_BLUE , ANSI .RESET ]
652+ colors = [ANSI .BLUE , ANSI .BOLD , ANSI . REGULAR , ANSI .RESET ]
651653
652654 # There is a space before "..." to ensure that source file names can be
653655 # Ctrl + clicked in the VS Code terminal.
654- compile_source_message = "{0 }Compiling {1 }$SOURCE{0 } ...{2 }" .format (* colors )
655- java_compile_source_message = "{0 }Compiling {1 }$SOURCE{0 } ...{2 }" .format (* colors )
656- compile_shared_source_message = "{0 }Compiling shared {1 }$SOURCE{0 } ...{2 }" .format (* colors )
657- link_program_message = "{0 }Linking Program {1 }$TARGET{0 } ...{2 }" .format (* colors )
658- link_library_message = "{0 }Linking Static Library {1 }$TARGET{0 } ...{2 }" .format (* colors )
659- ranlib_library_message = "{0 }Ranlib Library {1 }$TARGET{0 } ...{2 }" .format (* colors )
660- link_shared_library_message = "{0 }Linking Shared Library {1 }$TARGET{0 } ...{2 }" .format (* colors )
661- java_library_message = "{0 }Creating Java Archive {1 }$TARGET{0 } ...{2 }" .format (* colors )
662- compiled_resource_message = "{0 }Creating Compiled Resource {1 }$TARGET{0 } ...{2 }" .format (* colors )
663- generated_file_message = "{0 }Generating {1 }$TARGET{0 } ...{2 }" .format (* colors )
664-
665- env . Append ( CXXCOMSTR = compile_source_message )
666- env . Append ( CCCOMSTR = compile_source_message )
667- env . Append ( SHCCCOMSTR = compile_shared_source_message )
668- env . Append ( SHCXXCOMSTR = compile_shared_source_message )
669- env . Append ( ARCOMSTR = link_library_message )
670- env . Append ( RANLIBCOMSTR = ranlib_library_message )
671- env . Append ( SHLINKCOMSTR = link_shared_library_message )
672- env . Append ( LINKCOMSTR = link_program_message )
673- env . Append ( JARCOMSTR = java_library_message )
674- env . Append ( JAVACCOMSTR = java_compile_source_message )
675- env . Append ( RCCOMSTR = compiled_resource_message )
676- env . Append ( GENCOMSTR = generated_file_message )
656+ compile_source_message = "{}Compiling {}$SOURCE{} ...{}" .format (* colors )
657+ java_compile_source_message = "{}Compiling {}$SOURCE{} ...{}" .format (* colors )
658+ compile_shared_source_message = "{}Compiling shared {}$SOURCE{} ...{}" .format (* colors )
659+ link_program_message = "{}Linking Program {}$TARGET{} ...{}" .format (* colors )
660+ link_library_message = "{}Linking Static Library {}$TARGET{} ...{}" .format (* colors )
661+ ranlib_library_message = "{}Ranlib Library {}$TARGET{} ...{}" .format (* colors )
662+ link_shared_library_message = "{}Linking Shared Library {}$TARGET{} ...{}" .format (* colors )
663+ java_library_message = "{}Creating Java Archive {}$TARGET{} ...{}" .format (* colors )
664+ compiled_resource_message = "{}Creating Compiled Resource {}$TARGET{} ...{}" .format (* colors )
665+ generated_file_message = "{}Generating {}$TARGET{} ...{}" .format (* colors )
666+
667+ env [ " CXXCOMSTR" ] = compile_source_message
668+ env [ " CCCOMSTR" ] = compile_source_message
669+ env [ " SHCCCOMSTR" ] = compile_shared_source_message
670+ env [ " SHCXXCOMSTR" ] = compile_shared_source_message
671+ env [ " ARCOMSTR" ] = link_library_message
672+ env [ " RANLIBCOMSTR" ] = ranlib_library_message
673+ env [ " SHLINKCOMSTR" ] = link_shared_library_message
674+ env [ " LINKCOMSTR" ] = link_program_message
675+ env [ " JARCOMSTR" ] = java_library_message
676+ env [ " JAVACCOMSTR" ] = java_compile_source_message
677+ env [ " RCCOMSTR" ] = compiled_resource_message
678+ env [ " GENCOMSTR" ] = generated_file_message
677679
678680
679681def detect_visual_c_compiler_version (tools_env ):
0 commit comments