Update sconscript for SSE optimisations

This commit is contained in:
Simon Robertshaw 2012-07-20 21:19:37 +01:00
parent d6de5fc997
commit 78b1ffb11d

View File

@ -25,15 +25,24 @@ def SetupSpawn( env ):
AddOption('--opengl-renderer',dest="opengl-renderer",action='store_true',default=False,help="Build with OpenGL renderer support. (requires --opengl)")
AddOption('--opengl',dest="opengl",action='store_true',default=False,help="Build with OpenGL interface support.")
AddOption('--win32',dest="win32",action='store_true',default=False,help="32bit Windows target.")
AddOption('--lin32',dest="lin32",action='store_true',default=False,help="32bit Linux target")
AddOption('--lin64',dest="lin64",action='store_true',default=False,help="64bit Linux target")
AddOption('--win32',dest="win32",action='store_true',default=False,help="32bit Windows platform target.")
AddOption('--lin32',dest="lin32",action='store_true',default=False,help="32bit Linux platform target")
AddOption('--lin64',dest="lin64",action='store_true',default=False,help="64bit Linux platform target")
AddOption('--macosx',dest="macosx",action='store_true',default=False,help="Mac OS X platform target")
AddOption('--static',dest="static",action="store_true",default=False,help="Static linking, reduces external library dependancies but increased file size")
AddOption('--pthreadw32-static',dest="ptw32-static",action="store_true",default=False,help="Use PTW32_STATIC_LIB for pthreadw32 headers")
AddOption('--release',dest="release",action='store_true',default=False,help="Enable optimisations (Will slow down compiling)")
AddOption('--lua-dir',dest="lua-dir",default=False,help="Directory for lua includes")
AddOption('--sdl-dir',dest="sdl-dir",default=False,help="Directory for SDL includes")
AddOption('--tool',dest="toolprefix",default=False,help="Prefix")
AddOption('--sse',dest="sse",action='store_true',default=False,help="Enable SSE optimisations")
AddOption('--sse2',dest="sse2",action='store_true',default=False,help="Enable SSE2 optimisations")
AddOption('--sse3',dest="sse3",action='store_true',default=False,help="Enable SSE3 optimisations")
AddOption('--x86',dest="x86",action='store_true',default=True,help="Target Intel x86 platform")
if((not GetOption('lin32')) and (not GetOption('lin64')) and (not GetOption('win32')) and (not GetOption('macosx'))):
print "You must specify a platform to target"
raise SystemExit(1)
if(GetOption('win32')):
env = Environment(tools = ['mingw'], ENV = os.environ)
@ -112,7 +121,22 @@ if(GetOption('lin32') or GetOption('lin64')):
if(GetOption('release')):
env.Append(CCFLAGS=['-O3', '-ftree-vectorize', '-msse2', '-funsafe-math-optimizations', '-ffast-math', '-fomit-frame-pointer', '-funsafe-loop-optimizations', '-Wunsafe-loop-optimizations'])
env.Append(CCFLAGS=['-O3', '-ftree-vectorize', '-funsafe-math-optimizations', '-ffast-math', '-fomit-frame-pointer', '-funsafe-loop-optimizations', '-Wunsafe-loop-optimizations'])
if(GetOption('x86')):
env.Append(CPPDEFINES='X86')
if(GetOption('sse')):
env.Append(CCFLAGS='-msse')
env.Append(CPPDEFINES='X86_SSE')
if(GetOption('sse2')):
env.Append(CCFLAGS='-msse2')
env.Append(CPPDEFINES='X86_SSE2')
if(GetOption('sse3')):
env.Append(CCFLAGS='-msse3')
env.Append(CPPDEFINES='X86_SSE3')
if(GetOption('opengl')):
env.Append(CPPDEFINES=["OGLI", "PIX32OGL"])