[cig-commits] commit: added a flag for building with profiling (-pg), using the flag with_profile

Mercurial hg at geodynamics.org
Mon Nov 24 11:23:04 PST 2008


changeset:   77:a593f9e95cbd
user:        DavidLee
date:        Wed May 21 00:48:09 2008 +0000
files:       config/SConfig/Project.py
description:
added a flag for building with profiling (-pg), using the flag with_profile


diff -r cec8222dffe6 -r a593f9e95cbd config/SConfig/Project.py
--- a/config/SConfig/Project.py	Mon Apr 14 02:12:16 2008 +0000
+++ b/config/SConfig/Project.py	Wed May 21 00:48:09 2008 +0000
@@ -15,6 +15,8 @@ class Project(SConfig.Node):
                                     'Build static libraries', 1),
             SCons.Script.BoolOption('shared_libraries',
                                     'Build shared libraries', 1),
+            SCons.Script.BoolOption('with_profile',
+                                    'Generate profiling symbols', 0),
             ('build_dir', 'Temporary build directory', 'build')
             )
 
@@ -29,6 +31,7 @@ class Project(SConfig.Node):
         self.ctx.Display("  Shared libraries: %s\n" % str(bool(self.env['shared_libraries'])))
         self.ctx.Display("  Using build directory: %s\n" % self.env['build_dir'])
         self.ctx.Display("  Debugging symbols: %s\n" % str(bool(self.env['with_debug'])))
+        self.ctx.Display("  Profiling symbols: %s\n" % str(bool(self.env['with_profile'])))
         return True
 
     def setup(self):
@@ -48,6 +51,10 @@ class Project(SConfig.Node):
         if self.env['with_debug']:
             scons_env.MergeFlags('-g')
 
+	# Setup the profiling flags.
+	if self.env['with_profile']:
+	    scons_env.MergeFlags('-pg')
+
         # Setup the include paths.
         inc_dir = self.env.get_build_path('include')
         self.backup_variable(scons_env, 'CPPPATH', old_state)



More information about the CIG-COMMITS mailing list