From 2ea7529bd1cf3d732ffbbbc42129b2a18534a1e9 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Fri, 8 Jan 2010 01:22:42 +0100 Subject: SConstruct: Use options to determine build type. --- SConstruct | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'SConstruct') 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') -- cgit v1.2.3