diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-11-28 17:05:08 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-12-07 12:41:43 +0000 |
commit | 9fa13b2c5f43d6fbaeb4360ac54391a91b3e9e54 (patch) | |
tree | 61887ff3f838bf890bbd6d95302e862d829da9a0 /build_scripts/options.py | |
parent | 4d82ee992992251bcadf0097a4df60fe7c3b7ef8 (diff) |
Make quiet builds really quiet
The change does a couple of things:
- Sets the distutils / setuptools --verbose option to 0
- Sets the distutils / setuptools --quiet option to 1
- The options above end up calling distutils.log.set_verbosity(0)
- Passes the QUIET_BUILD cmake option from setup.py to every
CMake invocation, when --quiet is passed to setup.py
- Sets the CMAKE_INSTALL_MESSAGE variable to silence messages
regarding installation of files
- Sets the CMAKE_RULE_MESSAGES variable to disable progress report
in makefiles when building each source file
- Overrides the CMake message function, not to display
STATUS / info / untyped messages (still displays warnings and
errors)
- Changes the build / install elapsed time messages to always be
printed even in quiet mode
- Reverts the previously introduced set_quiet function in utils,
because log.set_verbosity() now takes care of silencing those
messages
As a result, there's a lot less clutter when doing a quiet build.
Warnings, errors and shiboken output is still displayed.
Change-Id: Ie05c593ce7dc0aa04554c2d2859ce655233ddb9f
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'build_scripts/options.py')
-rw-r--r-- | build_scripts/options.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/build_scripts/options.py b/build_scripts/options.py index 3a5caf392..644649938 100644 --- a/build_scripts/options.py +++ b/build_scripts/options.py @@ -59,12 +59,15 @@ class Options(object): # Dictionary containing values of all the possible options. self.dict = {} - def has_option(self, name): + def has_option(self, name, remove=True): """ Returns True if argument '--name' was passed on the command line. """ option = '--' + name count = sys.argv.count(option) - for i in range(count): + remove_count = count + if not remove and count > 0: + remove_count -= 1 + for i in range(remove_count): sys.argv.remove(option) if count > 1: _warn_multiple_option(option) @@ -120,8 +123,8 @@ class Options(object): options = Options() -def has_option(name): - return options.has_option(name) +def has_option(*args, **kwargs): + return options.has_option(*args, **kwargs) def option_value(*args,**kwargs): @@ -171,7 +174,7 @@ OPTION_MODULE_SUBSET = option_value("module-subset") OPTION_RPATH_VALUES = option_value("rpath") OPTION_QT_CONF_PREFIX = option_value("qt-conf-prefix") OPTION_QT_SRC = option_value("qt-src-dir") -OPTION_QUIET = has_option('quiet') +OPTION_QUIET = has_option('quiet', remove=False) OPTION_VERBOSE_BUILD = has_option("verbose-build") OPTION_SANITIZE_ADDRESS = has_option("sanitize-address") OPTION_SNAPSHOT_BUILD = has_option("snapshot-build") |