diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-02 07:36:03 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-02 07:36:03 +0000 |
commit | 527c739c43984bc49da5d0de4989e1d81d4a74d5 (patch) | |
tree | d285aee08646c31b345760eb6e936f11271b8f10 | |
parent | 7ae14832d77548f53270fd8c207811114a78bded (diff) | |
download | chromium_src-527c739c43984bc49da5d0de4989e1d81d4a74d5.zip chromium_src-527c739c43984bc49da5d0de4989e1d81d4a74d5.tar.gz chromium_src-527c739c43984bc49da5d0de4989e1d81d4a74d5.tar.bz2 |
Fixes and enhancements
* Configurable CHROME_BUILD_TYPE command line or external environment
variable for selecting appropriate release_impl*.scons settings
(_checksenabled, _coverage, _dom_stats, _official, _purify).
* Configurable CHROMIUM_BUILD command line or external environment
variable for selecting appropriate chromium_build*.scons settings
(_google_chrome).
* Configurable /INCREMENTAL linking via command line or external
environment variable ($INCREMENTAL), through appropriate setting
of an internal $CHROMIUM_INCREMENTAL_FLAGS construction variable.
* Full link of release builds by default.
* Alphabetize *.scons files in the mac_env.FilterOut() list.
* Explicitly set _checksenabled.scons link flags.
Review URL: http://codereview.chromium.org/13039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6210 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/base_unittests.scons | 6 | ||||
-rw-r--r-- | build/SConscript.main | 56 | ||||
-rw-r--r-- | build/debug.scons | 7 | ||||
-rw-r--r-- | build/internal/essential.scons | 7 | ||||
-rw-r--r-- | build/internal/release_defaults.scons | 6 | ||||
-rw-r--r-- | build/internal/release_impl_checksenabled.scons | 10 | ||||
-rw-r--r-- | chrome/SConscript | 4 | ||||
-rw-r--r-- | chrome/browser/browser.scons | 3 | ||||
-rw-r--r-- | site_scons/site_tools/chromium_builders.py | 15 |
9 files changed, 77 insertions, 37 deletions
diff --git a/base/base_unittests.scons b/base/base_unittests.scons index 833339e..d913bc8 100644 --- a/base/base_unittests.scons +++ b/base/base_unittests.scons @@ -25,12 +25,6 @@ if env['PLATFORM'] in ('posix', 'darwin'): '$LIBEVENT_DIR/using_libevent.scons', ]) -env.Prepend( - CPPDEFINES = [ - 'GOOGLE_CHROME_BUILD', - ], -) - if env['PLATFORM'] == 'win32': env.Prepend( CCFLAGS = [ diff --git a/build/SConscript.main b/build/SConscript.main index ba0a267..146f897 100644 --- a/build/SConscript.main +++ b/build/SConscript.main @@ -19,19 +19,43 @@ default_warnings = ['no-no-parallel-support'] SetOption('warn', default_warnings + GetOption('warn')) -chrome_build_type = ARGUMENTS.get('CHROME_BUILD_TYPE') -if chrome_build_type is None: - chrome_build_type = os.environ.get('CHROME_BUILD_TYPE', ''), - -chromium_build = ARGUMENTS.get('CHROMIUM_BUILD') -if chromium_build is None: - chromium_build = os.environ.get('CHROMIUM_BUILD', ''), +# Variables for controlling the build. +# +# The following variables can be set either on the command line +# or in the external environment when executing SCons, with the +# command line overriding any environment setting. +# +# CHROME_BUILD_TYPE +# When set, applies settings from the file +# build\internal\release_impl${CHROME_BUILD_TYPE}.scons +# to be applied to the construction environment. +# +# CHROMIUM_BUILD +# When set, applies settings from the file +# build\internal\chromium_build${CHROMIUM_BUILD}.scons +# to be applied to the construction environment. +# +# INCREMENTAL +# Controls whether or not libraries and executable programs are +# linked incrementally. When set to any True value (1, T, y, True), +# uses the /INCREMENTAL flag to the Microsoft linker. An +# explicit False value (0, f, N, false) uses the /INCREMENTAL:NO. +# When not set, the default is to link debug (developer) builds +# incrementally, but release builds use full links. +# +clvars = Variables('scons.opts', ARGUMENTS) +clvars.AddVariables( + ('CHROME_BUILD_TYPE', '', os.environ.get('CHROME_BUILD_TYPE', '')), + ('CHROMIUM_BUILD', '', os.environ.get('CHROMIUM_BUILD', '')), + BoolVariable('INCREMENTAL', '', os.environ.get('INCREMENTAL')), +) root_env = Environment( tools = ['component_setup', 'chromium_builders', 'chromium_load_component'], + variables = clvars, # Requested list of system (shared) libraries, from the comma separated # SYSTEM_LIBS command-line argument @@ -39,9 +63,6 @@ root_env = Environment( # All supported system libraries, for the help message all_system_libs = [], - CHROME_BUILD_TYPE = chrome_build_type, - CHROMIUM_BUILD = chromium_build, - CHROME_SRC_DIR = '$MAIN_DIR/..', DESTINATION_ROOT = '$MAIN_DIR/Hammer', @@ -214,6 +235,7 @@ del windows_env['LINKFLAGS_DEBUG'] del windows_env['CCFLAGS_OPTIMIZED'] windows_env['PDB'] = '${TARGET.base}.pdb' +windows_env['MSVC_BATCH'] = True # TODO(bradnelson): this should not need to be gated on host platform. if root_env['PLATFORM'] in ['win32', 'cygwin']: @@ -504,19 +526,19 @@ mac_env.Replace( mac_env.FilterOut( BUILD_SCONSCRIPTS = [ - '$BSPATCH_DIR/bspatch.scons', - '$BSDIFF_DIR/bsdiff.scons', - '$LIBJPEG_DIR/SConscript', - '$LIBXML_DIR/SConscript', - '$LIBXSLT_DIR/SConscript', '$BREAKPAD_DIR/SConscript', - '$CHROME_DIR/SConscript', + '$BSDIFF_DIR/bsdiff.scons', + '$BSPATCH_DIR/bspatch.scons', + '$CHROME_DIR/chrome.scons', '$GEARS_DIR/SConscript', '$GOOGLE_UPDATE_DIR/SConscript', + '$LIBJPEG_DIR/libjpeg.scons', + '$LIBXML_DIR/libxml.scons', + '$LIBXSLT_DIR/libxslt.scons', '$RLZ_DIR/SConscript', '$SANDBOX_DIR/sandbox.scons', - 'build/SConscript.v8', '$WEBKIT_DIR/SConscript', + 'build/SConscript.v8', ], ) diff --git a/build/debug.scons b/build/debug.scons index f056fcd..4cf6bf8 100644 --- a/build/debug.scons +++ b/build/debug.scons @@ -22,6 +22,12 @@ env.Append( ) if env['PLATFORM'] == 'win32': + if env.get('INCREMENTAL') is None: + # INCREMENTAL was not specified on the command line or in the + # external environment; debug default is incremental link. + env['INCREMENTAL'] = True + env['CHROMIUM_INCREMENTAL_FLAGS'] = '/INCREMENTAL' + env.Append( CCFLAGS = [ '/Od', # VCCLCompilerTool.Optimization="0" @@ -29,7 +35,6 @@ if env['PLATFORM'] == 'win32': '/MTd', # VCCLCompilerTool.RuntimeLibrary="1" ], LINKFLAGS = [ - '/INCREMENTAL', # VCLinkerTool.LinkIncremental="2" '/DEBUG', ], ) diff --git a/build/internal/essential.scons b/build/internal/essential.scons index e2ffc53..56770d9 100644 --- a/build/internal/essential.scons +++ b/build/internal/essential.scons @@ -17,10 +17,17 @@ env.Append( ], LINKFLAGS = [ '$CHROMIUM_LINK_OPT_FLAGS', + '$CHROMIUM_INCREMENTAL_FLAGS', ], ) if env['PLATFORM'] == 'win32': + incremental = env.get('INCREMENTAL') + if incremental is not None: + if incremental: + env['CHROMIUM_INCREMENTAL_FLAGS'] = '/INCREMENTAL' + else: + env['CHROMIUM_INCREMENTAL_FLAGS'] = '/INCREMENTAL:NO' env.Append( ARFLAGS = [ '/ignore:4221', diff --git a/build/internal/release_defaults.scons b/build/internal/release_defaults.scons index 612bcbc..5d36cf1 100644 --- a/build/internal/release_defaults.scons +++ b/build/internal/release_defaults.scons @@ -21,6 +21,12 @@ env.Append( ) if env.Bit('windows'): + if env.get('INCREMENTAL') is None: + # INCREMENTAL was not specified on the command line or in the + # external environment; release default is full link. + env['INCREMENTAL'] = False + env['CHROMIUM_INCREMENTAL_FLAGS'] = '/INCREMENTAL:NO' + env.Replace( CHROMIUM_CC_OPT_FLAGS = [ '/O2', # VCCLCompilerTool.Optimization="2" diff --git a/build/internal/release_impl_checksenabled.scons b/build/internal/release_impl_checksenabled.scons index 0bdab12..c0b4993 100644 --- a/build/internal/release_impl_checksenabled.scons +++ b/build/internal/release_impl_checksenabled.scons @@ -19,6 +19,13 @@ env.Append( ) if env.Bit('windows'): + env.Replace( + CHROMIUM_LINK_OPT_FLAGS = [ + '/OPT:REF', # VCLinkerTool.OptimizeReferences="2" + '/OPT:NOICF', # VCLinkerTool.EnableCOMDATFolding="2" + '/OPT:NOWIN98', # VCLinkerTool.OptimizeForWindows98="1" + ], + ), env.Append( CCFLAGS = [ '/Oy-', @@ -26,8 +33,5 @@ if env.Bit('windows'): ], LINKFLAGS = [ '/INCREMENTAL:NO', # VCLinkerTool.LinkIncremental="1" - '/OPT:REF', # VCLinkerTool.OptimizeReferences="2" - '/OPT:ICF', # VCLinkerTool.EnableCOMDATFolding="2" - '/OPT:NOWIN98', # VCLinkerTool.OptimizeForWindows98="1" ], ) diff --git a/chrome/SConscript b/chrome/SConscript index 8d07343..92d8c33 100644 --- a/chrome/SConscript +++ b/chrome/SConscript @@ -25,9 +25,6 @@ env.Prepend( # TODO(port) if env_res['PLATFORM'] == 'win32': env_res.Append( - CPPDEFINES = [ - 'GOOGLE_CHROME_BUILD', - ], CPPPATH = [ '.', '$CHROME_SRC_DIR', @@ -75,7 +72,6 @@ env_dll.Prepend( 'U_STATIC_IMPLEMENTATION', 'PNG_USER_CONFIG', 'CHROME_PNG_WRITE_SUPPORT', - 'GOOGLE_CHROME_BUILD', 'LIBXSLT_STATIC', 'LIBXML_STATIC', '_WINDLL', diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons index 7c3e2d4..1d56bdf 100644 --- a/chrome/browser/browser.scons +++ b/chrome/browser/browser.scons @@ -35,9 +35,6 @@ env.Prepend( # generated from history/history_indexer.idl. 'history', ], - CPPDEFINES = [ - 'GOOGLE_CHROME_BUILD', - ], ) if env['PLATFORM'] == 'win32': diff --git a/site_scons/site_tools/chromium_builders.py b/site_scons/site_tools/chromium_builders.py index a5c3964..e93dbea 100644 --- a/site_scons/site_tools/chromium_builders.py +++ b/site_scons/site_tools/chromium_builders.py @@ -10,11 +10,17 @@ customization we need to make to the different things we build. def generate(env): def ChromeProgram(env, *args, **kw): - return env.ComponentProgram(*args, **kw) + result = env.ComponentProgram(*args, **kw) + if env.get('INCREMENTAL'): + env.Precious(result) + return result env.AddMethod(ChromeProgram) def ChromeTestProgram(env, *args, **kw): - return env.ComponentTestProgram(*args, **kw) + result = env.ComponentTestProgram(*args, **kw) + if env.get('INCREMENTAL'): + env.Precious(*result) + return result env.AddMethod(ChromeTestProgram) def ChromeStaticLibrary(env, *args, **kw): @@ -24,7 +30,10 @@ def generate(env): def ChromeSharedLibrary(env, *args, **kw): kw['COMPONENT_STATIC'] = False - return [env.ComponentLibrary(*args, **kw)[0]] + result = [env.ComponentLibrary(*args, **kw)[0]] + if env.get('INCREMENTAL'): + env.Precious(result) + return result env.AddMethod(ChromeSharedLibrary) def ChromeObject(env, *args, **kw): |