env.Depends(SWIG, 'debug/flags.cc')
Source('debug/flags.cc')
+# version tags
+env.Command('sim/tags.cc', None,
+ MakeAction('util/cpt_upgrader.py --get-cc-file > $TARGET',
+ Transform("VER TAGS")))
+
# Embed python files. All .py files that have been indicated by a
# PySource() call in a SConscript need to be embedded into the M5
# library. To do that, we compile the file to byte code, marshal the
# Add additional warnings here that should not be applied to
# the SWIG generated code
- new_env.Append(CXXFLAGS='-Wmissing-declarations')
+ new_env.Append(CXXFLAGS=['-Wmissing-declarations',
+ '-Wdelete-non-virtual-dtor'])
if env['GCC']:
# Depending on the SWIG version, we also need to supress
# initializers.
swig_env.Append(CCFLAGS=['-Wno-uninitialized',
'-Wno-missing-field-initializers',
- '-Wno-unused-but-set-variable'])
-
- # If gcc supports it, also warn for deletion of derived
- # classes with non-virtual desctructors. For gcc >= 4.7 we
- # also have to disable warnings about the SWIG code having
- # potentially uninitialized variables.
- if compareVersions(env['GCC_VERSION'], '4.7') >= 0:
- new_env.Append(CXXFLAGS='-Wdelete-non-virtual-dtor')
- swig_env.Append(CCFLAGS='-Wno-maybe-uninitialized')
+ '-Wno-unused-but-set-variable',
+ '-Wno-maybe-uninitialized'])
# Only gcc >= 4.9 supports UBSan, so check both the version
# and the command-line option before adding the compiler and
new_env.Append(LINKFLAGS='-fsanitize=undefined')
if env['CLANG']:
- # Always enable the warning for deletion of derived classes
- # with non-virtual destructors
- new_env.Append(CXXFLAGS=['-Wdelete-non-virtual-dtor'])
-
swig_env.Append(CCFLAGS=[
# Some versions of SWIG can return uninitialized values
'-Wno-sometimes-uninitialized',
new_env.Append(LINKFLAGS='-fsanitize=undefined')
werror_env = new_env.Clone()
- werror_env.Append(CCFLAGS='-Werror')
+ # Treat warnings as errors but white list some warnings that we
+ # want to allow (e.g., deprecation warnings).
+ werror_env.Append(CCFLAGS=['-Werror',
+ '-Wno-error=deprecated-declarations',
+ '-Wno-error=deprecated',
+ ])
def make_obj(source, static, extra_deps = None):
'''This function adds the specified source to the correct