Commit e3a3a537 authored by Jose Fonseca's avatar Jose Fonseca

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.
parent 67450f06
...@@ -130,7 +130,6 @@ def generate(env): ...@@ -130,7 +130,6 @@ def generate(env):
env['msvc'] = env['CC'] == 'cl' env['msvc'] = env['CC'] == 'cl'
# shortcuts # shortcuts
debug = env['debug']
machine = env['machine'] machine = env['machine']
platform = env['platform'] platform = env['platform']
x86 = env['machine'] == 'x86' x86 = env['machine'] == 'x86'
...@@ -412,7 +411,7 @@ def generate(env): ...@@ -412,7 +411,7 @@ def generate(env):
if env['platform'] == 'windows' and msvc: if env['platform'] == 'windows' and msvc:
# Choose the appropriate MSVC CRT # Choose the appropriate MSVC CRT
# http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx # http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
if env['debug']: if env['build'] in ('debug', 'checked'):
env.Append(CCFLAGS = ['/MTd']) env.Append(CCFLAGS = ['/MTd'])
env.Append(SHCCFLAGS = ['/LDd']) env.Append(SHCCFLAGS = ['/LDd'])
else: else:
...@@ -444,7 +443,7 @@ def generate(env): ...@@ -444,7 +443,7 @@ def generate(env):
else: else:
env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group' env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
if msvc: if msvc:
if not env['debug']: if env['build'] != 'debug':
# enable Link-time Code Generation # enable Link-time Code Generation
linkflags += ['/LTCG'] linkflags += ['/LTCG']
env.Append(ARFLAGS = ['/LTCG']) env.Append(ARFLAGS = ['/LTCG'])
......
...@@ -124,7 +124,7 @@ def generate(env): ...@@ -124,7 +124,7 @@ def generate(env):
# Some of the LLVM C headers use the inline keyword without # Some of the LLVM C headers use the inline keyword without
# defining it. # defining it.
env.Append(CPPDEFINES = [('inline', '__inline')]) env.Append(CPPDEFINES = [('inline', '__inline')])
if env['debug']: if env['build'] in ('debug', 'checked'):
# LLVM libraries are static, build with /MT, and they # LLVM libraries are static, build with /MT, and they
# automatically link agains LIBCMT. When we're doing a # automatically link agains LIBCMT. When we're doing a
# debug build we'll be linking against LIBCMTD, so disable # debug build we'll be linking against LIBCMTD, so disable
......
...@@ -122,7 +122,7 @@ def get_wce600_paths(env): ...@@ -122,7 +122,7 @@ def get_wce600_paths(env):
host_cpu = os.environ.get('_HOSTCPUTYPE', 'i386') host_cpu = os.environ.get('_HOSTCPUTYPE', 'i386')
target_cpu = os.environ.get('_TGTCPU', 'x86') target_cpu = os.environ.get('_TGTCPU', 'x86')
if env['debug']: if env['build'] == 'debug':
build = 'debug' build = 'debug'
else: else:
build = 'retail' build = 'retail'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment