diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-01-08 01:22:42 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-01-08 01:22:42 +0100 |
commit | 2ea7529bd1cf3d732ffbbbc42129b2a18534a1e9 (patch) | |
tree | 56e647209d331ad2d6d956f227dce62ebb70afdb | |
parent | 03d8ee4b0e08c2209518e296de7f9a49183a4a47 (diff) |
SConstruct: Use options to determine build type.
-rw-r--r-- | SConstruct | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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') |