scons: Restrict whole program optimization to release builds.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 8 Feb 2011 10:26:17 +0000 (10:26 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 9 Feb 2011 18:31:21 +0000 (18:31 +0000)
It just takes forever, so it is inadequate for continuous testings
(i.e., checked and profile build types).

scons/gallium.py

index df060f01a3c696cf165a27a339328ba69659de7b..c4144273a5598a9774e32bca52883224011d3db1 100644 (file)
@@ -402,13 +402,19 @@ def generate(env):
               '/Od', # disable optimizations
               '/Oi', # enable intrinsic functions
               '/Oy-', # disable frame pointer omission
-              '/GL-', # disable whole program optimization
             ]
         else:
             ccflags += [
                 '/O2', # optimize for speed
+            ]
+        if env['build'] == 'release':
+            ccflags += [
                 '/GL', # enable whole program optimization
             ]
+        else:
+            ccflags += [
+                '/GL-', # disable whole program optimization
+            ]
         ccflags += [
             '/fp:fast', # fast floating point 
             '/W3', # warning level
@@ -498,7 +504,7 @@ def generate(env):
         else:
             env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
     if msvc:
-        if env['build'] != 'debug':
+        if env['build'] == 'release':
             # enable Link-time Code Generation
             linkflags += ['/LTCG']
             env.Append(ARFLAGS = ['/LTCG'])