Use env.Append when setting compiler settings

This commit is contained in:
Nils O. Selåsdal
2012-11-06 22:17:46 +01:00
parent ee44f30f11
commit f6fb7595d3
+6 -7
View File
@@ -1,5 +1,4 @@
import os import os
import platform
#version info of the library #version info of the library
revision = svn_version = os.popen('svnversion').read()[:-1] revision = svn_version = os.popen('svnversion').read()[:-1]
@@ -55,18 +54,18 @@ env = Environment(tools = ['default', 'textfile'])
env.AddMethod(InstallPerm) env.AddMethod(InstallPerm)
Export('env', 'build_type', 'prefix', 'version_info', 'test_xml') Export('env', 'build_type', 'prefix', 'version_info', 'test_xml')
env['CFLAGS'] = ['-Wall', '-Wextra', '-pipe', '-ggdb'] env.Append(CFLAGS = ['-Wall', '-Wextra', '-pipe', '-ggdb'])
env['LINKFLAGS'] = ['-O2'] env.Append(LINKFLAGS = ['-O2'])
env['CPPDEFINES'] = ['_FILE_OFFSET_BITS=64'] env.Append(CPPDEFINES = ['_FILE_OFFSET_BITS=64'])
if build_type == 'release': if build_type == 'release':
env['CFLAGS'] += ['-O2'] env.Append(CFLAGS = ['-O2'])
#this will turn off assert() #this will turn off assert()
env['CPPDEFINES'] += ['NDEBUG'] env.Append(CPPDEFINES = ['NDEBUG'])
elif build_type == 'debug': elif build_type == 'debug':
env['CPPDEFINES'] += ['DEBUG'] env.Append(CPPDEFINES = ['DEBUG'])
#put all .sconsign files in one place #put all .sconsign files in one place
env.SConsignFile() env.SConsignFile()