summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-01-08 01:22:42 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-01-08 01:22:42 +0100
commit2ea7529bd1cf3d732ffbbbc42129b2a18534a1e9 (patch)
tree56e647209d331ad2d6d956f227dce62ebb70afdb
parent03d8ee4b0e08c2209518e296de7f9a49183a4a47 (diff)
SConstruct: Use options to determine build type.
-rw-r--r--SConstruct10
1 files changed, 4 insertions, 6 deletions
diff --git a/SConstruct b/SConstruct
index 2de6c3c..5bc30a3 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1,4 +1,4 @@
-import os
+AddOption('--release', action = 'store_true')
env = Environment()
@@ -11,12 +11,10 @@ env = conf.Finish()
env.Append(CCFLAGS = ['-std=c99', '-D_GNU_SOURCE', '-pthread'])
-if 'DEBUG' in os.environ:
- print 'Debug build'
- env.Append(CCFLAGS = ['-g'])
-else:
- print 'Release build'
+if GetOption('release'):
env.Append(CCFLAGS = ['-O2'])
+else:
+ env.Append(CCFLAGS = ['-g'])
env.Append(LINKFLAGS = ['-pthread'])
env.ParseConfig('pkg-config --cflags --libs libconfig')