diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-09-04 23:31:32 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-09-04 23:31:32 +0300 |
commit | c7e367ac161d1b7faead7e2de99072ca135d0df8 (patch) | |
tree | 9b964ef09cb43fae56892b96a2b6ebfd926c095f /meson.py | |
parent | 6cca79b052b75bf174c2e482cc5d3e1a6cec4b02 (diff) | |
download | meson-c7e367ac161d1b7faead7e2de99072ca135d0df8.zip meson-c7e367ac161d1b7faead7e2de99072ca135d0df8.tar.gz meson-c7e367ac161d1b7faead7e2de99072ca135d0df8.tar.bz2 |
Can set default warning with an envvar.
Diffstat (limited to 'meson.py')
-rwxr-xr-x | meson.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -30,6 +30,14 @@ backendlist = ['ninja', 'vs2010', 'xcode'] build_types = ['plain', 'debug', 'debugoptimized', 'release'] warning_levels = ['1', '2', '3'] +default_warning = '1' +try: + warn_candidate = os.environ['MESON_WARN_LEVEL'] + if warn_candidate in warning_levels: + default_warning = warn_candidate +except KeyError: + pass + if mesonlib.is_windows(): def_prefix = 'c:/' else: @@ -63,8 +71,8 @@ parser.add_argument('--unity', action='store_true', dest='unity', default=False, help='unity build') parser.add_argument('--werror', action='store_true', dest='werror', default=False,\ help='Treat warnings as errors') -parser.add_argument('--warnlevel', default='1', dest='warning_level', choices=warning_levels,\ - help='Level of compiler warnings to use (larger is more)') +parser.add_argument('--warnlevel', default=default_warning, dest='warning_level', choices=warning_levels,\ + help='Level of compiler warnings to use (larger is more, default is %(default)s)') parser.add_argument('--cross-file', default=None, dest='cross_file', help='file describing cross compilation environment') parser.add_argument('-D', action='append', dest='projectoptions', default=[], |