summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-09-22 08:25:58 -0700
committerNathan Binkert <nate@binkert.org>2008-09-22 08:25:58 -0700
commit38dd9687ce7f852126161b38430b301376642b51 (patch)
treedffae095009fc2c09b90992430548b2b6b11bd6c /src
parent6efb930e19056e3421f3bb1996bf370883873b32 (diff)
downloadgem5-38dd9687ce7f852126161b38430b301376642b51.tar.xz
scons: Separate swig environment so we can have different flags.
Swig code isn't quite perfect, so let's not turn on all of the warnings.
Diffstat (limited to 'src')
-rw-r--r--src/SConscript11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/SConscript b/src/SConscript
index 36cbbfa78..9734a3618 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -543,6 +543,7 @@ SwigSource('m5.objects', params_file)
# Build all swig modules
swig_modules = []
+cc_swig_sources = []
for source,package in swig_sources:
filename = str(source)
assert filename.endswith('.i')
@@ -559,7 +560,7 @@ for source,package in swig_sources:
env.Depends(cc_file, source)
swig_modules.append(Value(module))
- Source(cc_file)
+ cc_swig_sources.append(File(cc_file))
PySource(package, py_file)
# Generate the main swig init file
@@ -945,12 +946,18 @@ def makeEnv(label, objsfx, strip = False, **kwargs):
newEnv.Label = label
newEnv.Append(**kwargs)
+ swig_env = newEnv.Copy()
+ swig_env.Append(CCFLAGS='-Wno-uninitialized')
+ swig_objs = [ swig_env.Object(s) for s in cc_swig_sources ]
+
# First make a library of everything but main() so other programs can
# link against m5.
#
# SCons doesn't know to append a library suffix when there is a '.' in the
# name. Use '_' instead.
- m5lib = newEnv.Library('m5_' + label, make_objs(cc_lib_sources, newEnv))
+
+ m5lib = newEnv.Library('m5_' + label,
+ make_objs(cc_lib_sources, newEnv) + swig_objs)
# Now link a stub with main() and the library.
exe = 'm5.' + label # final executable