|
18 |
class GccTraits(CompilerTraits): |
18 |
class GccTraits(CompilerTraits): |
19 |
def __init__(self): |
19 |
def __init__(self): |
20 |
super(GccTraits, self).__init__() |
20 |
super(GccTraits, self).__init__() |
21 |
# cumulative list of warnings per level |
21 |
# cumulative list of warnings per level: levels 1, 2, 3 |
22 |
self.warnings_flags = [['-Wall'], ['-Werror'], ['-Wextra']] |
22 |
self.warnings_flags = [['-Wall'], ['-Werror'], ['-Wextra']] |
23 |
|
23 |
|
24 |
def get_warnings_flags(self, level): |
24 |
def get_warnings_flags(self, level): |
|
159 |
opt.add_option('--check-profile', |
159 |
opt.add_option('--check-profile', |
160 |
help=('print out current build profile'), |
160 |
help=('print out current build profile'), |
161 |
default=False, dest='check_profile', action="store_true") |
161 |
default=False, dest='check_profile', action="store_true") |
|
|
162 |
opt.add_option('--disable-werror', |
163 |
help=('disable -Werror flag (warnings treated as errors'), |
164 |
default=False, dest='disable_werror', action="store_true") |
162 |
def configure(conf): |
165 |
def configure(conf): |
163 |
cc = conf.env['COMPILER_CC'] or None |
166 |
cc = conf.env['COMPILER_CC'] or None |
164 |
cxx = conf.env['COMPILER_CXX'] or None |
167 |
cxx = conf.env['COMPILER_CXX'] or None |
|
181 |
optimizations = compiler.get_optimization_flags(opt_level) |
184 |
optimizations = compiler.get_optimization_flags(opt_level) |
182 |
debug, debug_defs = compiler.get_debug_flags(dbg_level) |
185 |
debug, debug_defs = compiler.get_debug_flags(dbg_level) |
183 |
warnings = compiler.get_warnings_flags(warn_level) |
186 |
warnings = compiler.get_warnings_flags(warn_level) |
184 |
|
187 |
|
|
|
188 |
if Options.options.disable_werror: |
189 |
try: |
190 |
warnings.remove ('-Werror') |
191 |
except ValueError: |
192 |
pass |
193 |
|
185 |
if cc and not conf.env['CCFLAGS']: |
194 |
if cc and not conf.env['CCFLAGS']: |
186 |
conf.env.append_value('CCFLAGS', optimizations) |
195 |
conf.env.append_value('CCFLAGS', optimizations) |
187 |
conf.env.append_value('CCFLAGS', debug) |
196 |
conf.env.append_value('CCFLAGS', debug) |