Mesa (master): scons: New build= option, with support for checked builds.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Wed Sep 29 13:25:21 UTC 2010


Module: Mesa
Branch: master
Commit: e3a3a5378e4a1b45f30fcb26730d6c73e623cfac
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e3a3a5378e4a1b45f30fcb26730d6c73e623cfac

Author: José Fonseca <jfonseca at vmware.com>
Date:   Wed Sep 29 14:24:52 2010 +0100

scons: New build= option, with support for checked builds.

Where checked build is compiler optimizations plus debugging checks --
ideal for testing CPU bound loads and running test automation loads.

---

 scons/gallium.py |    5 ++---
 scons/llvm.py    |    2 +-
 scons/wcesdk.py  |    2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/scons/gallium.py b/scons/gallium.py
index 97b4721..b065b7b 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -130,7 +130,6 @@ def generate(env):
     env['msvc'] = env['CC'] == 'cl'
 
     # shortcuts
-    debug = env['debug']
     machine = env['machine']
     platform = env['platform']
     x86 = env['machine'] == 'x86'
@@ -412,7 +411,7 @@ def generate(env):
     if env['platform'] == 'windows' and msvc:
         # Choose the appropriate MSVC CRT
         # http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
-        if env['debug']:
+        if env['build'] in ('debug', 'checked'):
             env.Append(CCFLAGS = ['/MTd'])
             env.Append(SHCCFLAGS = ['/LDd'])
         else:
@@ -444,7 +443,7 @@ def generate(env):
         else:
             env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
     if msvc:
-        if not env['debug']:
+        if env['build'] != 'debug':
             # enable Link-time Code Generation
             linkflags += ['/LTCG']
             env.Append(ARFLAGS = ['/LTCG'])
diff --git a/scons/llvm.py b/scons/llvm.py
index d88d6e3..39fbb91 100644
--- a/scons/llvm.py
+++ b/scons/llvm.py
@@ -124,7 +124,7 @@ def generate(env):
             # Some of the LLVM C headers use the inline keyword without
             # defining it.
             env.Append(CPPDEFINES = [('inline', '__inline')])
-            if env['debug']:
+            if env['build'] in ('debug', 'checked'):
                 # LLVM libraries are static, build with /MT, and they
                 # automatically link agains LIBCMT. When we're doing a
                 # debug build we'll be linking against LIBCMTD, so disable
diff --git a/scons/wcesdk.py b/scons/wcesdk.py
index bf73c2d..e82f255 100644
--- a/scons/wcesdk.py
+++ b/scons/wcesdk.py
@@ -122,7 +122,7 @@ def get_wce600_paths(env):
     host_cpu = os.environ.get('_HOSTCPUTYPE', 'i386')
     target_cpu = os.environ.get('_TGTCPU', 'x86')
 
-    if env['debug']:
+    if env['build'] == 'debug':
         build = 'debug'
     else:
         build = 'retail'




More information about the mesa-commit mailing list