summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-05-23 22:48:48 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-05-23 22:48:48 +0200
commit4ada43585c11eabd6aa94dcd7ab6d62952796a26 (patch)
tree407e98030faced997c7cb67b525058084ab9f9ad
parent12f709042181115db56bf7fc6e234aaaed751b9d (diff)
Added a profiling-option to SConstruct to compile and link with -pg.
-rw-r--r--SConstruct5
1 files changed, 5 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 1e7e66e..1a49017 100644
--- a/SConstruct
+++ b/SConstruct
@@ -7,6 +7,7 @@ env = Environment(
engine = Glob('engine/*.cpp')
AddOption('--release', action = 'store_true')
+AddOption('--profiling', action = 'store_true')
if env['PLATFORM'] == 'darwin':
env.Append(CPPFLAGS = '')
@@ -24,6 +25,10 @@ else:
if not GetOption('release'):
env.Append(CPPFLAGS = ['-Wall', '-g'])
+if GetOption('profiling'):
+ env.Append(CPPFLAGS = ['-pg'])
+ env.Append(LINKFLAGS = ['-pg'])
+
env.Program('foo', ['main.cpp'] + engine)
# vim: syn=python