diff --git a/.gitignore b/.gitignore index 7b7d8e9..2e4c459 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /copy/ /build/ +/build-release/ .sconsign* .pydevproject *.kate-swp diff --git a/SConstruct b/SConstruct index cf81332..8d051c0 100644 --- a/SConstruct +++ b/SConstruct @@ -1,3 +1,3 @@ -build_dir = ARGUMENTS.get('build_dir', 'build') +build_dir = ARGUMENTS.get('BUILD_DIR', 'build') VariantDir(build_dir, 'src', duplicate = 0) SConscript(build_dir + '/SConstruct') diff --git a/demo/SConstruct b/demo/SConstruct index cf81332..8d051c0 100644 --- a/demo/SConstruct +++ b/demo/SConstruct @@ -1,3 +1,3 @@ -build_dir = ARGUMENTS.get('build_dir', 'build') +build_dir = ARGUMENTS.get('BUILD_DIR', 'build') VariantDir(build_dir, 'src', duplicate = 0) SConscript(build_dir + '/SConstruct') diff --git a/dev-build.sh b/dev-build.sh index d21ea79..41dad88 100755 --- a/dev-build.sh +++ b/dev-build.sh @@ -2,6 +2,7 @@ set -e -scons PREFIX=$1 install +scons PREFIX=$1 DEBUG=1 install +scons PREFIX=$1-release BUILD_DIR=build-release install cd demo scons diff --git a/src/SConstruct b/src/SConstruct index 59d2bf2..7feccb8 100644 --- a/src/SConstruct +++ b/src/SConstruct @@ -8,6 +8,8 @@ version = '0.1.0' # user options +DEBUG = ARGUMENTS.get('DEBUG', 0) + opts = Variables(name + '.conf') opts.Add(PathVariable('PREFIX', 'Directory to install under', '/usr/local', PathVariable.PathAccept)) opts.Update(env) @@ -21,7 +23,11 @@ libs = ['gtk+-3.0', 'glib-2.0', 'cairo', 'SDL2_mixer'] # compute build options -flags = ' -O0 -g -lm -Wall -fmessage-length=0 ' +flags = ' -lm -Wall -fmessage-length=0 ' +if int(DEBUG): + flags += ' -O0 -g ' +else: + flags += ' -O3 ' # files lists diff --git a/src/helianthus.conf b/src/helianthus.conf new file mode 100644 index 0000000..9b61c4e --- /dev/null +++ b/src/helianthus.conf @@ -0,0 +1 @@ +PREFIX = '/home/bw/opt/helianthus-release'