Add 'QUIET` boolean configuration option to reduce build verbosity (default: no)

To enable =>  `./scons/scons.py configure QUIET=y`
This commit is contained in:
Artem Pavlenko 2019-03-07 19:01:24 +00:00
parent 1377ec9752
commit 0db5d6231f

View file

@ -149,6 +149,7 @@ def init_environment(env):
#### SCons build options and initial setup #### #### SCons build options and initial setup ####
env = Environment(ENV=os.environ) env = Environment(ENV=os.environ)
init_environment(env) init_environment(env)
def fix_path(path): def fix_path(path):
@ -472,6 +473,7 @@ opts.AddVariables(
BoolVariable('MAPNIK_RENDER', 'Compile and install a utility to render a map to an image', 'True'), BoolVariable('MAPNIK_RENDER', 'Compile and install a utility to render a map to an image', 'True'),
BoolVariable('COLOR_PRINT', 'Print build status information in color', 'True'), BoolVariable('COLOR_PRINT', 'Print build status information in color', 'True'),
BoolVariable('BIGINT', 'Compile support for 64-bit integers in mapnik::value', 'True'), BoolVariable('BIGINT', 'Compile support for 64-bit integers in mapnik::value', 'True'),
BoolVariable('QUIET', 'Reduce build verbosity', 'False'),
) )
# variables to pickle after successful configure step # variables to pickle after successful configure step
@ -540,7 +542,8 @@ pickle_store = [# Scons internal variables
'HOST', 'HOST',
'QUERIED_GDAL_DATA', 'QUERIED_GDAL_DATA',
'QUERIED_ICU_DATA', 'QUERIED_ICU_DATA',
'QUERIED_PROJ_LIB' 'QUERIED_PROJ_LIB',
'QUIET'
] ]
# Add all other user configurable options to pickle pickle_store # Add all other user configurable options to pickle pickle_store
@ -2119,6 +2122,13 @@ if not HELP_REQUESTED:
replace_path('CAIRO_LIBPATHS',search,replace) replace_path('CAIRO_LIBPATHS',search,replace)
replace_path('CAIRO_CPPPATHS',search,replace) replace_path('CAIRO_CPPPATHS',search,replace)
# Adjust verbosity
if env['QUIET']:
env.Append(CXXCOMSTR = "Compiling $SOURCE")
env.Append(SHCXXCOMSTR = "Compiling shared $SOURCE")
env.Append(LINKCOMSTR = "Linking $TARGET")
env.Append(SHLINKCOMSTR = "Linking shared $TARGET")
# export env so it is available in build.py files # export env so it is available in build.py files
Export('env') Export('env')