summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'SConstruct')
-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')