SCons: Use colored output if available, change "colored"->"verbose"

This commit is contained in:
Błażej Szczygieł 2016-10-17 21:04:13 +02:00
parent e96c49f849
commit 2bf4553fe0
5 changed files with 6 additions and 14 deletions

View File

@ -65,6 +65,8 @@ elif (os.name=="nt"):
custom_tools=['mingw'] custom_tools=['mingw']
env_base=Environment(tools=custom_tools); env_base=Environment(tools=custom_tools);
if 'TERM' in os.environ:
env_base['ENV']['TERM'] = os.environ['TERM']
env_base.AppendENVPath('PATH', os.getenv('PATH')) env_base.AppendENVPath('PATH', os.getenv('PATH'))
env_base.AppendENVPath('PKG_CONFIG_PATH', os.getenv('PKG_CONFIG_PATH')) env_base.AppendENVPath('PKG_CONFIG_PATH', os.getenv('PKG_CONFIG_PATH'))
env_base.global_defaults=global_defaults env_base.global_defaults=global_defaults
@ -142,7 +144,7 @@ opts.Add("LINKFLAGS", "Custom flags for the linker");
opts.Add('unix_global_settings_path', 'unix-specific path to system-wide settings. Currently only used by templates.','') opts.Add('unix_global_settings_path', 'unix-specific path to system-wide settings. Currently only used by templates.','')
opts.Add('disable_3d', 'Disable 3D nodes for smaller executable (yes/no)', "no") opts.Add('disable_3d', 'Disable 3D nodes for smaller executable (yes/no)', "no")
opts.Add('disable_advanced_gui', 'Disable advance 3D gui nodes and behaviors (yes/no)', "no") opts.Add('disable_advanced_gui', 'Disable advance 3D gui nodes and behaviors (yes/no)', "no")
opts.Add('colored', 'Enable colored output for the compilation (yes/no)', 'no') opts.Add('verbose', 'Enable verbose output for the compilation (yes/no)', 'yes')
opts.Add('deprecated','Enable deprecated features (yes/no)','yes') opts.Add('deprecated','Enable deprecated features (yes/no)','yes')
opts.Add('extra_suffix', 'Custom extra suffix added to the base filename of all generated binary files.', '') opts.Add('extra_suffix', 'Custom extra suffix added to the base filename of all generated binary files.', '')
opts.Add('vsproj', 'Generate Visual Studio Project. (yes/no)', 'no') opts.Add('vsproj', 'Generate Visual Studio Project. (yes/no)', 'no')
@ -329,8 +331,8 @@ if selected_platform in platform_list:
if (env['xml']=='yes'): if (env['xml']=='yes'):
env.Append(CPPFLAGS=['-DXML_ENABLED']) env.Append(CPPFLAGS=['-DXML_ENABLED'])
if (env['colored']=='yes'): if (env['verbose']=='no'):
methods.colored(sys,env) methods.no_verbose(sys,env)
Export('env') Export('env')

View File

@ -1416,7 +1416,7 @@ def save_active_platforms(apnames,ap):
logow.write(str) logow.write(str)
def colored(sys,env): def no_verbose(sys,env):
#If the output is not a terminal, do nothing #If the output is not a terminal, do nothing
if not sys.stdout.isatty(): if not sys.stdout.isatty():

View File

@ -91,9 +91,6 @@ def configure(env):
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
env["CC"]="clang" env["CC"]="clang"
env["LD"]="clang++" env["LD"]="clang++"
if (env["colored"]=="yes"):
if sys.stdout.isatty():
env.Append(CPPFLAGS=["-fcolor-diagnostics"])
import methods import methods

View File

@ -38,9 +38,6 @@ def configure(env):
env["CC"]="clang" env["CC"]="clang"
env["CXX"]="clang++" env["CXX"]="clang++"
env["LD"]="clang++" env["LD"]="clang++"
if (env["colored"]=="yes"):
if sys.stdout.isatty():
env.Append(CXXFLAGS=["-fcolor-diagnostics"])
is64=sys.maxsize > 2**32 is64=sys.maxsize > 2**32

View File

@ -94,10 +94,6 @@ def configure(env):
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
env.extra_suffix=".llvm" env.extra_suffix=".llvm"
if (env["colored"]=="yes"):
if sys.stdout.isatty():
env.Append(CXXFLAGS=["-fcolor-diagnostics"])
if (env["use_sanitizer"]=="yes"): if (env["use_sanitizer"]=="yes"):
env.Append(CXXFLAGS=['-fsanitize=address','-fno-omit-frame-pointer']) env.Append(CXXFLAGS=['-fsanitize=address','-fno-omit-frame-pointer'])
env.Append(LINKFLAGS=['-fsanitize=address']) env.Append(LINKFLAGS=['-fsanitize=address'])