changeset 5de232ed3a28 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=5de232ed3a28
description:
SCons: restore Werror option in src/SConscript
Partial backout of cset 8b223e308b08.
Although it's great that there's currently no need
for Werror=false in the current tree, some of us
have uncommitted code that still needs this option.
diffstat:
src/SConscript | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diffs (48 lines):
diff -r d062cc7a8bdf -r 5de232ed3a28 src/SConscript
--- a/src/SConscript Thu Apr 12 08:35:56 2012 -0400
+++ b/src/SConscript Fri Apr 13 08:13:04 2012 -0700
@@ -151,10 +151,11 @@
class Source(SourceFile):
'''Add a c/c++ source file to the build'''
- def __init__(self, source, swig = False, **guards):
+ def __init__(self, source, Werror=True, swig=False, **guards):
'''specify the source file, and any guards'''
super(Source, self).__init__(source, **guards)
+ self.Werror = Werror
self.swig = swig
class PySource(SourceFile):
@@ -843,10 +844,9 @@
new_env = env.Clone(OBJSUFFIX=objsfx, SHOBJSUFFIX=objsfx + 's')
new_env.Label = label
new_env.Append(**kwargs)
- # Always consider warnings errors
- new_env.Append(CCFLAGS='-Werror')
swig_env = new_env.Clone()
+ swig_env.Append(CCFLAGS='-Werror')
if env['GCC']:
swig_env.Append(CCFLAGS='-Wno-uninitialized')
swig_env.Append(CCFLAGS='-Wno-sign-compare')
@@ -857,6 +857,10 @@
if env['CLANG']:
swig_env.Append(CCFLAGS=['-Wno-unused-label'])
+
+ werror_env = new_env.Clone()
+ werror_env.Append(CCFLAGS='-Werror')
+
def make_obj(source, static, extra_deps = None):
'''This function adds the specified source to the correct
build environment, and returns the corresponding SCons Object
@@ -864,6 +868,8 @@
if source.swig:
env = swig_env
+ elif source.Werror:
+ env = werror_env
else:
env = new_env
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev