[gem5-dev] Change in public/gem5[master]: scons: Get rid of a flag which makes Werror optional.

2017-11-27 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/5982 )


Change subject: scons: Get rid of a flag which makes Werror optional.
..

scons: Get rid of a flag which makes Werror optional.

This flag wasn't being used. Also move the Werror code to the
SConstruct now that it's being applied universally.

Change-Id: I18b00d4b41bc1add9271ca299c020c14970a6926
Reviewed-on: https://gem5-review.googlesource.com/5982
Reviewed-by: Andreas Sandberg 
Reviewed-by: Nikos Nikoleris 
Maintainer: Andreas Sandberg 
---
M SConstruct
M src/SConscript
2 files changed, 14 insertions(+), 22 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
  Nikos Nikoleris: Looks good to me, approved



diff --git a/SConstruct b/SConstruct
index 36db216..09c3476 100755
--- a/SConstruct
+++ b/SConstruct
@@ -359,6 +359,13 @@
 shared_partial_flags = ['-r', '-nostdlib']
 main.Append(PSHLINKFLAGS=shared_partial_flags)
 main.Append(PLINKFLAGS=shared_partial_flags)
+
+# Treat warnings as errors but white list some warnings that we
+# want to allow (e.g., deprecation warnings).
+main.Append(CCFLAGS=['-Werror',
+ '-Wno-error=deprecated-declarations',
+ '-Wno-error=deprecated',
+])
 else:
 print termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal,
 print "Don't know what compiler options to use for your compiler."
diff --git a/src/SConscript b/src/SConscript
index a40955b..34bbcc0 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -172,11 +172,10 @@
 self.tags.add(Source._current_group_tag)

 '''Add a c/c++ source file to the build'''
-def __init__(self, source, tags=None, add_tags=None, Werror=True):
+def __init__(self, source, tags=None, add_tags=None):
 '''specify the source file, and any tags'''
 super(Source, self).__init__(source, tags, add_tags)
 self._add_link_group_tag()
-self.Werror = Werror

 class PySource(SourceFile):
 '''Add a python source file to the named package'''
@@ -952,31 +951,17 @@
 new_env.Label = label
 new_env.Append(**kwargs)

-werror_env = new_env.Clone()
-# 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
-build environment, and returns the corresponding SCons Object
-nodes'''
-
-if source.Werror:
-env = werror_env
-else:
-env = new_env
+def make_obj(source, static, extra_deps=None):
+'''This function creates a scons node of the requested type, and  
sets

+up any additional dependencies.'''

 if static:
-obj = env.StaticObject(source.tnode)
+obj = new_env.StaticObject(source.tnode)
 else:
-obj = env.SharedObject(source.tnode)
+obj = new_env.SharedObject(source.tnode)

 if extra_deps:
-env.Depends(obj, extra_deps)
+new_env.Depends(obj, extra_deps)

 return obj


--
To view, visit https://gem5-review.googlesource.com/5982
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I18b00d4b41bc1add9271ca299c020c14970a6926
Gerrit-Change-Number: 5982
Gerrit-PatchSet: 4
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Nikos Nikoleris 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in public/gem5[master]: scons: Get rid of a flag which makes Werror optional.

2017-11-21 Thread Gabe Black (Gerrit)
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/5982



Change subject: scons: Get rid of a flag which makes Werror optional.
..

scons: Get rid of a flag which makes Werror optional.

This flag wasn't being used. Also move the Werror code to the
SConstruct now that it's being applied universally.

Change-Id: I18b00d4b41bc1add9271ca299c020c14970a6926
---
M SConstruct
M src/SConscript
2 files changed, 14 insertions(+), 22 deletions(-)



diff --git a/SConstruct b/SConstruct
index 36db216..09c3476 100755
--- a/SConstruct
+++ b/SConstruct
@@ -359,6 +359,13 @@
 shared_partial_flags = ['-r', '-nostdlib']
 main.Append(PSHLINKFLAGS=shared_partial_flags)
 main.Append(PLINKFLAGS=shared_partial_flags)
+
+# Treat warnings as errors but white list some warnings that we
+# want to allow (e.g., deprecation warnings).
+main.Append(CCFLAGS=['-Werror',
+ '-Wno-error=deprecated-declarations',
+ '-Wno-error=deprecated',
+])
 else:
 print termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal,
 print "Don't know what compiler options to use for your compiler."
diff --git a/src/SConscript b/src/SConscript
index a40955b..34bbcc0 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -172,11 +172,10 @@
 self.tags.add(Source._current_group_tag)

 '''Add a c/c++ source file to the build'''
-def __init__(self, source, tags=None, add_tags=None, Werror=True):
+def __init__(self, source, tags=None, add_tags=None):
 '''specify the source file, and any tags'''
 super(Source, self).__init__(source, tags, add_tags)
 self._add_link_group_tag()
-self.Werror = Werror

 class PySource(SourceFile):
 '''Add a python source file to the named package'''
@@ -952,31 +951,17 @@
 new_env.Label = label
 new_env.Append(**kwargs)

-werror_env = new_env.Clone()
-# 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
-build environment, and returns the corresponding SCons Object
-nodes'''
-
-if source.Werror:
-env = werror_env
-else:
-env = new_env
+def make_obj(source, static, extra_deps=None):
+'''This function creates a scons node of the requested type, and  
sets

+up any additional dependencies.'''

 if static:
-obj = env.StaticObject(source.tnode)
+obj = new_env.StaticObject(source.tnode)
 else:
-obj = env.SharedObject(source.tnode)
+obj = new_env.SharedObject(source.tnode)

 if extra_deps:
-env.Depends(obj, extra_deps)
+new_env.Depends(obj, extra_deps)

 return obj


--
To view, visit https://gem5-review.googlesource.com/5982
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I18b00d4b41bc1add9271ca299c020c14970a6926
Gerrit-Change-Number: 5982
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev