[SCons] Fix warning suppression in external code

This commit is contained in:
Ray Speth 2014-02-21 19:08:54 +00:00
parent dba9ddd858
commit 0ff3afe5ea

View file

@ -5,17 +5,27 @@ localenv = env.Clone()
def prep_default(env):
return env.Clone()
localenv = env.Clone()
# Suppress warnings from external code and auto-generated code
if 'g++' in localenv['CXX']:
localenv.Append(CCFLAGS=['-Wno-format', '-Wno-format-security',
'-Wno-unused-result'])
if localenv['CC'] == 'clang':
localenv['CCFLAGS'].append('-w')
return localenv
def prep_fortran(env):
localenv = env.Clone()
localenv = prep_default(env)
localenv.Prepend(CPPPATH='#include/cantera/base') # for config.h
return localenv
def prep_f2c(env):
localenv = env.Clone()
localenv = prep_default(env)
localenv.Prepend(CPPPATH=Dir('#ext/f2c_libs'))
if not localenv['HAS_TIMES_H']:
@ -26,35 +36,17 @@ def prep_f2c(env):
print "INFO 2: prep_f2c: adding MSDOS to CPPDEFINES"
print "INFO 2: CPPDEFINES ", localenv['CPPDEFINES']
# The F2C code generates a lot of warnings designed to catch
# programmer errors, but since this is autogenerated code, those
# warnings are irrelevant.
if '-Wall' in localenv['CCFLAGS']:
localenv['CCFLAGS'].remove('-Wall')
localenv['CCFLAGS'].append('-Wno-format-security')
elif '/W3' in localenv['CCFLAGS']:
localenv['CCFLAGS'].remove('/W3')
elif '-Wcheck' in localenv['CCFLAGS']:
localenv['CCFLAGS'].remove('-Wcheck')
if localenv['CC'] == 'clang':
localenv['CCFLAGS'].append('-w')
return localenv
def prep_sundials(env):
localenv = env.Clone()
localenv = prep_default(env)
localenv.Prepend(CPPPATH=Dir('#ext/cvode/include'))
# Suppress warnings from external code
if '-Wall' in localenv['CCFLAGS']:
localenv['CCFLAGS'].append('-Wno-format')
return localenv
def prep_gtest(env):
localenv = env.Clone()
localenv = prep_default(env)
localenv.Prepend(CPPPATH=[Dir('#ext/gtest'),
Dir('#ext/gtest/include')],
CPPDEFINES={'GTEST_HAS_PTHREAD': 0})