diff options
author | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-13 23:44:51 +0000 |
---|---|---|
committer | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-13 23:44:51 +0000 |
commit | 981bcd3333f0890b3e2c8f48424297b63c61a5d5 (patch) | |
tree | de987627b4e8fa5e7d967bc6aa2b5b5a5bd84f08 /build | |
parent | 814a9aba9358a6302eee45ac05d60b1f881cc51b (diff) | |
download | chromium_src-981bcd3333f0890b3e2c8f48424297b63c61a5d5.zip chromium_src-981bcd3333f0890b3e2c8f48424297b63c61a5d5.tar.gz chromium_src-981bcd3333f0890b3e2c8f48424297b63c61a5d5.tar.bz2 |
Allow optimized builds on Linux.
Review URL: http://codereview.chromium.org/10857
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5406 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/SConscript.main | 32 | ||||
-rw-r--r-- | build/SConscript.v8 | 17 | ||||
-rw-r--r-- | build/using_v8.scons | 20 |
3 files changed, 55 insertions, 14 deletions
diff --git a/build/SConscript.main b/build/SConscript.main index cccbd6a..cf59228 100644 --- a/build/SConscript.main +++ b/build/SConscript.main @@ -37,13 +37,12 @@ root_env = Environment( CHROME_SRC_DIR = '$MAIN_DIR/..', DESTINATION_ROOT = '$MAIN_DIR/Hammer', - TARGET_ROOT = '$DESTINATION_ROOT', # Where ComponentTestProgram() will build test executables. - TESTS_DIR = '$TARGET_ROOT', + TESTS_DIR = '$DESTINATION_ROOT', # Where ComponentProgram() will build program executables. - STAGING_DIR = '$TARGET_ROOT', + STAGING_DIR = '$DESTINATION_ROOT', # Where ComponentLibrary() will build libraries. LIBS_DIR = '$COMPONENT_LIBRARY_DIR', @@ -441,16 +440,8 @@ windows_env.AppendENVPath('PATH', ';C:\\WINDOWS\\system32') # Linux specific linux_env = root_env.Clone() -environment_list.append(linux_env) linux_env.Tool('target_platform_linux') -linux_env.Tool('target_debug') linux_env.Tool('yacc') -linux_env.Replace( - BUILD_TYPE = 'debug-linux', - BUILD_TYPE_DESCRIPTION = 'Linux debug build', -) -linux_env.Append(BUILD_GROUPS = ['default']) - # TODO(bradnelson): this is needed for now because target_platform_linux has # OS_LINUX defined in a weird way. @@ -568,6 +559,25 @@ if root_env['PLATFORM'] in ['linux', 'linux2', 'posix']: 'libxslt requested in SYSTEM_LIBS but not found\n') sys.exit(1) +linux_dbg = linux_env.Clone() +environment_list.append(linux_dbg) +linux_dbg.Replace( + BUILD_TYPE = 'dbg', + BUILD_TYPE_DESCRIPTION = 'Linux debug build', +) +linux_dbg.Tool('target_debug') +linux_dbg.Append(BUILD_GROUPS = ['default']) + +linux_opt = linux_env.Clone() +environment_list.append(linux_opt) +# Disable rpath for faster startup. +linux_opt.Append(RPATH = []) +linux_opt.Replace( + BUILD_TYPE = 'opt', + BUILD_TYPE_DESCRIPTION = 'Linux optimized build', +) +linux_opt.Tool('target_optimized') + # -------------------------------------------------------------------------- # Mac specific diff --git a/build/SConscript.v8 b/build/SConscript.v8 index 1e7cfb0..22717b8 100644 --- a/build/SConscript.v8 +++ b/build/SConscript.v8 @@ -13,8 +13,14 @@ try: except AttributeError: cpu_flag = '' +# The v8 build script wants a 'debug'/'release' string to tell it whether +# to build optimized. Convert our build flags into that form. +mode = 'release' +if env['TARGET_DEBUG']: + mode = 'debug' + env = env.Clone( - V8_MODE = 'debug', + V8_MODE = mode, V8_MODE_DIR = '$V8_DIR/obj/$V8_MODE', V8_SCONS_COM = '$PYTHON $SCONS $SCONSFLAGS mode=$V8_MODE', SCONS='$CHROME_SRC_DIR/third_party/scons/scons.py', @@ -36,9 +42,14 @@ if not os.path.exists(env.Dir('$OBJ_ROOT/v8').abspath): Mkdir(env.Dir('$OBJ_ROOT/v8').abspath) +# v8 builds all outputs "foo" instead as "foo_g" in debug mode. +binsuffix = '' +if env['TARGET_DEBUG']: + binsuffix = '_g' + v8_scons_targets_off = [ - '$V8_DIR/shell_g${PROGSUFFIX}', - '$V8_DIR/${LIBPREFIX}v8_g${LIBSUFFIX}', + '$V8_DIR/shell%s${PROGSUFFIX}' % binsuffix, + '$V8_DIR/${LIBPREFIX}v8%s${LIBSUFFIX}' % binsuffix, '$V8_MODE_DIR/mksnapshot${PROGSUFFIX}', '$V8_MODE_DIR/libraries${OBJSUFFIX}', '$V8_MODE_DIR/snapshot-empty${OBJSUFFIX}', diff --git a/build/using_v8.scons b/build/using_v8.scons new file mode 100644 index 0000000..889bce1 --- /dev/null +++ b/build/using_v8.scons @@ -0,0 +1,20 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Settings for other components using the v8 library. +""" + +Import("env") + +# v8 builds the lib as v8_g in debug mode. +v8_lib = 'v8' +if env['TARGET_DEBUG']: + v8_lib = 'v8_g' + +env.Append( + LIBS = [ + v8_lib, + ], +) |