From 0e2de7481da3c74acc1a3120230e1bca2401919e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 2 Oct 2018 14:37:31 +0200 Subject: [PATCH] SCons: Set default warnings level to all (-Wall or /W3) --- SConstruct | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/SConstruct b/SConstruct index f1587e0280..1c50b53447 100644 --- a/SConstruct +++ b/SConstruct @@ -164,7 +164,7 @@ opts.Add(BoolVariable('disable_advanced_gui', "Disable advanced 3D GUI nodes and opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '') opts.Add(BoolVariable('verbose', "Enable verbose output for the compilation", False)) opts.Add(BoolVariable('vsproj', "Generate a Visual Studio solution", False)) -opts.Add(EnumVariable('warnings', "Set the level of warnings emitted during compilation", 'no', ('extra', 'all', 'moderate', 'no'))) +opts.Add(EnumVariable('warnings', "Set the level of warnings emitted during compilation", 'all', ('extra', 'all', 'moderate', 'no'))) opts.Add(BoolVariable('progress', "Show a progress indicator during compilation", True)) opts.Add(BoolVariable('dev', "If yes, alias for verbose=yes warnings=all", False)) opts.Add(EnumVariable('macports_clang', "Build using Clang from MacPorts", 'no', ('no', '5.0', 'devel'))) @@ -318,15 +318,12 @@ if selected_platform in platform_list: # must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11) detect.configure(env) - if (env["warnings"] == 'yes'): - print("WARNING: warnings=yes is deprecated; assuming warnings=all") - if env.msvc: # Truncations, narrowing conversions, signed/unsigned comparisons... disable_nonessential_warnings = ['/wd4267', '/wd4244', '/wd4305', '/wd4018', '/wd4800'] if (env["warnings"] == 'extra'): env.Append(CCFLAGS=['/Wall']) # Implies /W4 - elif (env["warnings"] == 'all' or env["warnings"] == 'yes'): + elif (env["warnings"] == 'all'): env.Append(CCFLAGS=['/W3'] + disable_nonessential_warnings) elif (env["warnings"] == 'moderate'): env.Append(CCFLAGS=['/W2'] + disable_nonessential_warnings) @@ -338,7 +335,7 @@ if selected_platform in platform_list: disable_nonessential_warnings = ['-Wno-sign-compare'] if (env["warnings"] == 'extra'): env.Append(CCFLAGS=['-Wall', '-Wextra']) - elif (env["warnings"] == 'all' or env["warnings"] == 'yes'): + elif (env["warnings"] == 'all'): env.Append(CCFLAGS=['-Wall'] + disable_nonessential_warnings) elif (env["warnings"] == 'moderate'): env.Append(CCFLAGS=['-Wall', '-Wno-unused'] + disable_nonessential_warnings)