scons: New build= option, with support for checked builds.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 29 Sep 2010 13:24:52 +0000 (14:24 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 29 Sep 2010 13:24:52 +0000 (14:24 +0100)
Where checked build is compiler optimizations plus debugging checks --
ideal for testing CPU bound loads and running test automation loads.

scons/gallium.py
scons/llvm.py
scons/wcesdk.py

index 97b47216636bc33cc1e22d2d24ba00793a51ada6..b065b7bc49fca8b8600bd04a6e482fec0c10d238 100644 (file)
@@ -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'])
index d88d6e3a5ad68ed58bc220c544258a25289b8774..39fbb910b6d55685271cc39e392a11d7de05fac5 100644 (file)
@@ -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
index bf73c2d73f0f0afe3fdba04268b13d946bd3a1f9..e82f255c515a7138a6629be3ce128c60e0621ba1 100644 (file)
@@ -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'