scons: Tweak MSVC release options.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 11 Dec 2009 15:16:22 +0000 (15:16 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 11 Dec 2009 15:16:22 +0000 (15:16 +0000)
Enable whole program optimizations and fast math.

scons/gallium.py

index 0e5de0d0f8e45179e36c4808507f3d64f7ddc00b..f4e82e8e0a58c046d3c36db99eb18426bc2372a6 100644 (file)
@@ -391,15 +391,15 @@ def generate(env):
         else:
             ccflags += [
                 '/O2', # optimize for speed
-                #'/fp:fast', # fast floating point 
+                '/GL', # enable whole program optimization
             ]
         ccflags += [
+            '/fp:fast', # fast floating point 
             '/W3', # warning level
             #'/Wp64', # enable 64 bit porting warnings
         ]
         if env['machine'] == 'x86':
             ccflags += [
-                #'/QIfist', # Suppress _ftol
                 #'/arch:SSE2', # use the SSE2 instructions
             ]
         if platform == 'windows':
@@ -477,6 +477,11 @@ def generate(env):
         ]
         # Handle circular dependencies in the libraries
         env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
+    if msvc:
+        if not env['debug']:
+            # enable Link-time Code Generation
+            linkflags += ['/LTCG']
+            env.Append(ARFLAGS = ['/LTCG'])
     if platform == 'windows' and msvc:
         # See also:
         # - http://msdn2.microsoft.com/en-us/library/y0zzbyt4.aspx