diff options
35 files changed, 506 insertions, 386 deletions
diff --git a/base/base_lib.scons b/base/base_lib.scons index 5118f04..ad9484b 100644 --- a/base/base_lib.scons +++ b/base/base_lib.scons @@ -10,20 +10,13 @@ Import('env') env = env.Clone() -env.SConscript([ +env.ApplySConscript([ '$ICU38_DIR/using_icu38.scons', -], {'env':env}) - -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], -) +]) if env['PLATFORM'] == 'win32': env.Prepend( CCFLAGS = [ - '/TP', '/Wp64', ], ) diff --git a/base/base_unittests.scons b/base/base_unittests.scons index b8aafbc..308372b 100644 --- a/base/base_unittests.scons +++ b/base/base_unittests.scons @@ -10,7 +10,7 @@ Import('env') env = env.Clone() -env.SConscript([ +env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$BASE_DIR/gfx/using_base_gfx.scons', '$GTEST_DIR/../using_gtest.scons', @@ -18,17 +18,14 @@ env.SConscript([ '$LIBPNG_DIR/using_libpng.scons', '$SKIA_DIR/using_skia.scons', '$ZLIB_DIR/using_zlib.scons', -], {'env':env}) +]) if env['PLATFORM'] in ('posix', 'darwin'): - env.SConscript([ + env.ApplySConscript([ '$LIBEVENT_DIR/using_libevent.scons', - ], {'env':env}) + ]) env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], CPPDEFINES = [ 'GOOGLE_CHROME_BUILD', ], @@ -40,23 +37,6 @@ if env['PLATFORM'] == 'win32': '/TP', '/WX', ], - CPPDEFINES = [ - '_WIN32_WINNT=0x0600', - 'WINVER=0x0600', - '_HAS_EXCEPTIONS=0', - ], - LINKFLAGS = [ - '/MANIFEST', - '/DELAYLOAD:"dwmapi.dll"', - '/DELAYLOAD:"uxtheme.dll"', - '/MACHINE:X86', - '/FIXED:No', - - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', - ], ) if env['PLATFORM'] == 'posix': diff --git a/base/gfx/base_gfx.scons b/base/gfx/base_gfx.scons index 0af67c6..7173340 100644 --- a/base/gfx/base_gfx.scons +++ b/base/gfx/base_gfx.scons @@ -10,23 +10,16 @@ Import('env') env = env.Clone() -env.SConscript([ +env.ApplySConscript([ '$ICU38_DIR/using_icu38.scons', '$LIBPNG_DIR/using_libpng.scons', '$SKIA_DIR/using_skia.scons', '$ZLIB_DIR/using_zlib.scons', -], {'env':env}) - -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], -) +]) if env['PLATFORM'] == 'win32': env.Prepend( CCFLAGS = [ - '/TP', '/WX', ], ) diff --git a/build/SConscript.main b/build/SConscript.main index b7665b5..be3e5e6 100644 --- a/build/SConscript.main +++ b/build/SConscript.main @@ -35,6 +35,9 @@ root_env = Environment( # All supported system libraries, for the help message all_system_libs = [], + CHROME_BUILD_TYPE = os.environ.get('CHROME_BUILD_TYPE', ''), + CHROMIUM_BUILD = os.environ.get('CHROMIUM_BUILD', ''), + CHROME_SRC_DIR = '$MAIN_DIR/..', DESTINATION_ROOT = '$MAIN_DIR/Hammer', @@ -160,6 +163,9 @@ if ARGUMENTS.get('VERBOSE') in (None, '0'): # Use timestamps change, followed by MD5 for speed root_env.Decider('MD5-timestamp') +# Incorporate settings that should apply globally (primarily to provide +# an obvious place for developmental experimentation). +root_env.ApplySConscript(['$CHROME_SRC_DIR/build/common.scons']) # The list of all leaf (fully described) environments. environment_list = [] @@ -273,23 +279,23 @@ root_env.Append(BUILD_SCONSCRIPTS = sconscripts) # Windows specific windows_env = root_env.Clone() -environment_list.append(windows_env) windows_env.Tool('target_platform_windows') -windows_env.Tool('target_debug') windows_env.Tool('component_targets_msvs') # Per target project support. windows_env.Tool('midl') -windows_env.Replace( - BUILD_TYPE = 'debug-windows', - BUILD_TYPE_DESCRIPTION = 'Windows debug build', -) -windows_env.Append(BUILD_GROUPS = ['default']) -# TODO(bradnelson): this is needed for now because target_platform_windows -# has OS_WINDOWS defined in a weird way. -windows_env.FilterOut(CPPDEFINES = ['OS_WINDOWS=OS_WINDOWS']) +# TODO(bradnelson): target_platform_windows defines a whole bunch of +# flags that we don't care about, including defining OS_WINDOWS in a +# way that we don't want, and (most especially) adding *_DEBUG and +# *_OPTIMIZED constructionv variables that add magic values to +# CCFLAGS. We override the normal variables (CPPDEFINES, CCFLAGS, +# LINKFLAGS, ARFLAGS) below, but get rid of the special Hammer ones +# here, until Hammer can be made a little nicer about htis. -windows_env['PDB'] = '${TARGET.base}.pdb' +del windows_env['CCFLAGS_DEBUG'] +del windows_env['LINKFLAGS_DEBUG'] +del windows_env['CCFLAGS_OPTIMIZED'] +windows_env['PDB'] = '${TARGET.base}.pdb' # TODO(bradnelson): this should not need to be gated on host platform. if root_env['PLATFORM'] in ['win32', 'cygwin']: @@ -318,110 +324,56 @@ windows_env.Replace( MSVS_ENV = msvs_env, YACC = '$CYGWIN_BIN_DIR/bison.exe', -) -windows_env.Append( ARFLAGS = [ '/nologo', ], CCFLAGS = [ '/nologo', - - '/Od', # no optimization - - '/RTC1', - '/MTd', # static link to crt, and debug version - '/Gy', - '/GR-', - - '/W3', - - '/Z7', - '/errorReport:prompt', - - '/wd4503', - '/wd4819', ], CPPDEFINES = [ - '_CRT_SECURE_NO_DEPRECATE', - '_CRT_NONSTDC_NO_WARNINGS', - '_CRT_NONSTDC_NO_DEPRECATE', - '_SCL_SECURE_NO_DEPRECATE', - - '_DEBUG', - - '_CRT_RAND_S', - ('_WIN32_WINNT', '0x0600'), - ('WINVER', '0x0600'), - 'WIN32', - '_WINDOWS', - ('_HAS_EXCEPTIONS', 0), - 'NOMINMAX', '_UNICODE', 'UNICODE', - - 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', - 'WIN32_LEAN_AND_MEAN', ], - CPPPATH = [ - '$PLATFORMSDK_VISTA/files/Include', - '$PLATFORMSDK_VISTA/files/VC/INCLUDE', - '$VISUAL_STUDIO/VC/atlmfc/include', - ], LIBS = [ 'advapi32.lib', 'comdlg32.lib', 'gdi32.lib', 'kernel32.lib', - 'msimg32.lib', 'odbc32.lib', 'odbccp32.lib', 'ole32.lib', 'oleaut32.lib', - 'psapi.lib', 'shell32.lib', 'user32.lib', - 'usp10.lib', 'uuid.lib', - 'version.lib', - 'wininet.lib', 'winspool.lib', - 'ws2_32.lib', 'DelayImp.lib', ], LINKFLAGS = [ '/nologo', - '/DEBUG', ], ICU_LIBS = ['icu'], ) -windows_env.Append( - LIBPATH = [ - '$PLATFORMSDK_VISTA/files/Lib', - '$PLATFORMSDK_VISTA/files/VC/LIB', - '$VISUAL_STUDIO/VC/atlmfc/lib', - ], -) - -# TODO(sgk): remove once we upgrade to SCons 0.98.4 -for var in ['INCLUDE', 'LIB', 'PATH']: - msvs_env[var] = msvs_env[var].split('|', 1)[0] - windows_env['ENV'][var] = windows_env['ENV'][var].split('|', 1)[0] - # Force scons to handle long include lines correctly. pchcom_fixed = windows_env['PCHCOM'] pchcom_fixed = pchcom_fixed.replace('${TARGETS[0]}', '$TARGET') pchcom_fixed = pchcom_fixed.replace('${TARGETS[1]}', '$TARGETS1') +# Below, we'll redefine $CXXFLAGS so its expansion doesn't include +# $CCFLAGS. Modify $PCHCOM, which was relying on this fact, so +# that $CCFLAGS still shows up in precompiled header compilations. +pchcom_fixed = pchcom_fixed.replace('$CXXFLAGS', '$CXXFLAGS $CCFLAGS') + windows_env.Replace( CCCOM = "${TEMPFILE('%s')}" % windows_env['CCCOM'], CXXCOM = "${TEMPFILE('%s')}" % windows_env['CXXCOM'], @@ -429,6 +381,11 @@ windows_env.Replace( SHCXXCOM = "${TEMPFILE('%s')}" % windows_env['SHCXXCOM'], PCHCOM = "${TEMPFILE('%s')}" % pchcom_fixed, TARGETS1 = '${TARGETS[1]}', + + # The SCons default for $CXXFLAGS contains $CCFLAGS, which is + # also on the $CCCOM command line string separately. Redefine + # $CXXFLAGS to avoid the duplication + CXXFLAGS = '$( /TP $)', ) windows_env['ENV']['PROGRAMFILES'] = os.environ.get('PROGRAMFILES', '') @@ -437,6 +394,24 @@ windows_env['ENV']['USERPROFILE'] = os.environ.get('USERPROFILE', '') windows_env.AppendENVPath('PATH', ';C:\\WINDOWS\\system32') +windows_dbg = windows_env.Clone() +environment_list.append(windows_dbg) +windows_dbg.Replace( + BUILD_TYPE = 'dbg', + BUILD_TYPE_DESCRIPTION = 'Windows debug build', +) +windows_dbg.Tool('target_debug') +windows_dbg.ApplySConscript(['$CHROME_SRC_DIR/build/debug.scons']) +windows_dbg.Append(BUILD_GROUPS = ['default']) + +windows_opt = windows_env.Clone() +environment_list.append(windows_opt) +windows_opt.Replace( + BUILD_TYPE = 'opt', + BUILD_TYPE_DESCRIPTION = 'Windows optimized build', +) +windows_opt.Tool('target_optimized') +windows_opt.ApplySConscript(['$CHROME_SRC_DIR/build/release.scons']) # -------------------------------------------------------------------------- # Linux specific @@ -568,6 +543,7 @@ linux_dbg.Replace( BUILD_TYPE_DESCRIPTION = 'Linux debug build', ) linux_dbg.Tool('target_debug') +linux_dbg.ApplySConscript(['$CHROME_SRC_DIR/build/debug.scons']) linux_dbg.Append(BUILD_GROUPS = ['default']) linux_opt = linux_env.Clone() @@ -579,6 +555,7 @@ linux_opt.Replace( BUILD_TYPE_DESCRIPTION = 'Linux optimized build', ) linux_opt.Tool('target_optimized') +linux_opt.ApplySConscript(['$CHROME_SRC_DIR/build/release.scons']) # -------------------------------------------------------------------------- # Mac specific @@ -587,6 +564,7 @@ mac_env = root_env.Clone() environment_list.append(mac_env) mac_env.Tool('target_platform_mac') mac_env.Tool('target_debug') +mac_env.ApplySConscript(['$CHROME_SRC_DIR/build/debug.scons']) mac_env.Replace( BUILD_TYPE = 'debug-mac', BUILD_TYPE_DESCRIPTION = 'Mac debug build', diff --git a/build/common.scons b/build/common.scons new file mode 100644 index 0000000..48c1f0e --- /dev/null +++ b/build/common.scons @@ -0,0 +1,16 @@ +# 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__ = """ +Common (no-op) settings for Chromium builds. +""" + +# This is where you can set values to affect *everything* in the build. + +Import("env") + +env.Append( + #CCFLAGS = [], + #LIBFLAGS = [], +) diff --git a/build/debug.scons b/build/debug.scons new file mode 100644 index 0000000..f056fcd --- /dev/null +++ b/build/debug.scons @@ -0,0 +1,35 @@ +# 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__ = """ +Debug settings for Chromium builds. + +Incorporates "essential" and "chromium_build" settings. +""" + +Import("env") + +env.ApplySConscript([ + 'internal/essential.scons', + 'internal/chromium_build${CHROMIUM_BUILD}.scons', +]) + +env.Append( + CPPDEFINES = [ + '_DEBUG', + ], +) + +if env['PLATFORM'] == 'win32': + env.Append( + CCFLAGS = [ + '/Od', # VCCLCompilerTool.Optimization="0" + '/RTC1', # VCCLCompilerTool.BasicRuntimeChecks="3" + '/MTd', # VCCLCompilerTool.RuntimeLibrary="1" + ], + LINKFLAGS = [ + '/INCREMENTAL', # VCLinkerTool.LinkIncremental="2" + '/DEBUG', + ], + ) diff --git a/build/external_code.scons b/build/external_code.scons new file mode 100644 index 0000000..45c039f --- /dev/null +++ b/build/external_code.scons @@ -0,0 +1,28 @@ +# 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__ = """ +External code settings for Chromium builds. +""" + +Import("env") + +if env['PLATFORM'] == 'win32': + env.Append( + CPPDEFINES = [ + '_CRT_SECURE_NO_DEPRECATE', + '_CRT_NONSTDC_NO_WARNINGS', + '_CRT_NONSTDC_NO_DEPRECATE', + '_SCL_SECURE_NO_DEPRECATE', + ], + CCFLAGS = [ + '/wd4800', + ], + ) + env.FilterOut( + CCFLAGS = [ + '/WX', # VCCLCompilerTool.WarnAsError="false" + '/Wp64', # VCCLCompilerTool.Detect64BitPortabilityProblems="false" + ], + ) diff --git a/build/internal/chromium_build.scons b/build/internal/chromium_build.scons new file mode 100644 index 0000000..397c365 --- /dev/null +++ b/build/internal/chromium_build.scons @@ -0,0 +1,15 @@ +# 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__ = """ +Chromium build settings. +""" + +Import("env") + +env.Append( + CPPDEFINES = [ + 'CHROMIUM_BUILD', + ], +) diff --git a/build/internal/chromium_build_google_chrome.scons b/build/internal/chromium_build_google_chrome.scons new file mode 100644 index 0000000..01dca62 --- /dev/null +++ b/build/internal/chromium_build_google_chrome.scons @@ -0,0 +1,15 @@ +# 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__ = """ +Release settings for Google Chrome. +""" + +Import("env") + +env.Append( + CPPDEFINES = [ + 'GOOGLE_CHROME_BUILD', + ], +) diff --git a/build/internal/essential.scons b/build/internal/essential.scons new file mode 100644 index 0000000..20dfdbb --- /dev/null +++ b/build/internal/essential.scons @@ -0,0 +1,102 @@ +# 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__ = """ +Essential settings for Chromium builds. +""" + +Import("env") + +env.Append( + CPPPATH = [ + '$CHROME_SRC_DIR', + ], +) + +if env['PLATFORM'] == 'win32': + env.Append( + ARFLAGS = [ + '/ignore:4221', + ], + CPPDEFINES = [ + ('_WIN32_WINNT', '0x0600'), + ('WINVER', '0x0600'), + 'WIN32', + '_WINDOWS', + ('_HAS_EXCEPTIONS', 0), + 'NOMINMAX', + '_CRT_RAND_S', + 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', + 'WIN32_LEAN_AND_MEAN', + '_SECURE_ATL', + ], + CPPPATH = [ + '$PLATFORMSDK_VISTA/files/Include', + '$PLATFORMSDK_VISTA/files/VC/INCLUDE', + '$VISUAL_STUDIO/VC/atlmfc/include', + ], + CCFLAGS = [ + '/GR-', # VCCLCompilerTool.RuntimeTypeInfo="false" + '/Gs', # VCCLCompilerTool.BufferSecurityCheck="true" + '/Gy', # VCCLCompilerTool.EnableFunctionLevelLinking="true" + '/W3', # VCCLCompilerTool.WarningLevel="3" + + # TODO(sgk): re-enable this + #'/WX', # WarnAsError="true" + + # In the old Visual Studio build, we used /Zi (edit and continue), + # VCCLComilerTool.DebugInformationFormat="3". + # + # /Zi ends up with multiple compiler invocations trying to updat + # the same vc80.pdb file at the same time, with race conditions + # and permission problems. We're using /Z7 because it makes things + # work even in parallel builds, without special config to avoid + # multiple simultaneous updates the vc80.pdb file. All the + # debugging information and capability still end up in the + # executables. + '/Z7', # VCCLCompilerTool.DebugInformationFormat="1" + + # VCCLCompilerTool.DisableSpecificWarnings="4503; 4819" + '/wd4503', + '/wd4819', + ], + LIBPATH = [ + '$PLATFORMSDK_VISTA/files/Lib', + '$PLATFORMSDK_VISTA/files/VC/LIB', + '$VISUAL_STUDIO/VC/atlmfc/lib', + ], + LIBS = [ + 'msimg32', + 'psapi', + 'usp10.lib', + 'version', + 'wininet', + 'ws2_32', + ], + LINKFLAGS = [ + '/DEBUG', + + '/MANIFEST', + '/DELAYLOAD:"dwmapi.dll"', + '/DELAYLOAD:"uxtheme.dll"', + '/MACHINE:X86', + '/FIXED:No', + + '/safeseh', + '/dynamicbase', + '/ignore:4199', + '/ignore:4221', + '/nxcompat', + ], + ) + env.FilterOut( + CCFLAGS = [ + '/GM', # VCCLCompilerTool.MinimalRebuild="false" + '/EH', # VCCLCompilerTool.ExceptionHandling="0" + ], + ) +elif env['PLATFORM'] == 'posix': + pass +elif env['PLATFORM'] == 'mac': + pass diff --git a/build/internal/release_defaults.scons b/build/internal/release_defaults.scons new file mode 100644 index 0000000..817dec2 --- /dev/null +++ b/build/internal/release_defaults.scons @@ -0,0 +1,35 @@ +# 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__ = """ +Default settings for all Chromium release builds. + +Incorporates "essential" settings. +""" + +Import("env") + +env.ApplySConscript([ + 'essential.scons', +]) + +env.Append( + CPPDEFINES = [ + 'NDEBUG', + ], +) + +if env.Bit('windows'): + env.Append( + CCFLAGS = [ + '/O2', # VCCLCompilerTool.Optimization="2" + '/GF', # VCCLCompilerTool.StringPooling="true" + ], + LINKFLAGS = [ + '/INCREMENTAL:NO', # VCLinkerTool.LinkIncremental="1" + '/OPT:REF', # VCLinkerTool.OptimizeReferences="2" + '/OPT:ICF', # VCLinkerTool.EnableCOMDATFolding="2" + '/OPT:NOWIN98', # VCLinkerTool.OptimizeForWindows98="1" + ], + ) diff --git a/build/internal/release_impl.scons b/build/internal/release_impl.scons new file mode 100644 index 0000000..23d0543 --- /dev/null +++ b/build/internal/release_impl.scons @@ -0,0 +1,18 @@ +# 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__ = """ +Release settings for Chromium builds. +""" + +Import("env") + +env.ApplySConscript(['release_defaults.scons']) + +if env.Bit('windows'): + env.Append( + CCFLAGS = [ + '/Oy-', + ], + ) diff --git a/build/internal/release_impl_checksenabled.scons b/build/internal/release_impl_checksenabled.scons new file mode 100644 index 0000000..0bdab12 --- /dev/null +++ b/build/internal/release_impl_checksenabled.scons @@ -0,0 +1,33 @@ +# 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__ = """ +Release settings for Chromium builds with checks enabled. +""" + +Import("env") + +env.ApplySConscript(['release_defaults.scons']) + +env.Append( + CPPDEFINES = [ + '_DEBUG', ' + ('_HAS_ITERATOR_DEBUGGING', '0'), + ('_SECURE_SCL', '0'), + ], +) + +if env.Bit('windows'): + env.Append( + CCFLAGS = [ + '/Oy-', + '/MTd', # VCCLCompilerTool.RuntimeLibrary="1" + ], + LINKFLAGS = [ + '/INCREMENTAL:NO', # VCLinkerTool.LinkIncremental="1" + '/OPT:REF', # VCLinkerTool.OptimizeReferences="2" + '/OPT:ICF', # VCLinkerTool.EnableCOMDATFolding="2" + '/OPT:NOWIN98', # VCLinkerTool.OptimizeForWindows98="1" + ], + ) diff --git a/build/internal/release_impl_coverage.scons b/build/internal/release_impl_coverage.scons new file mode 100644 index 0000000..ec8c547 --- /dev/null +++ b/build/internal/release_impl_coverage.scons @@ -0,0 +1,17 @@ +# 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__ = """ +Release settings for Chromium builds with code coverage +""" + +Import("env") + +env.ApplySConscript(['release_defaults.scons']) + +env.Append( + LINKFLAGS = [ + '/PROFILE', # VCLinkerTool.Profile="1" + ], +) diff --git a/build/internal/release_impl_dom_stats.scons b/build/internal/release_impl_dom_stats.scons new file mode 100644 index 0000000..492e56f --- /dev/null +++ b/build/internal/release_impl_dom_stats.scons @@ -0,0 +1,31 @@ +# 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__ = """ +Release settings for Chromium builds with DOM statistics. +""" + +Import("env") + +env.ApplySConscript(['release_defaults.scons']) + +env.Append( + CPPDEFINES = [ + 'NDEBUG', + 'ENABLE_DOM_STATS_COUNTERS', + ], +) + +if env['PLATFORM'] == 'win32': + env.Append( + CCFLAGS = [ + '/Oy-', + ] + LINKFLAGS = [ + '/INCREMENTAL:NO', # VCLinkerTool.LinkIncremental="1" + '/OPT:REF', # VCLinkerTool.OptimizeReferences="2" + '/OPT:ICF', # VCLinkerTool.EnableCOMDATFolding="2" + '/OPT:NOWIN98', # VCLinkerTool.OptimizeForWindows98="1" + ], + ) diff --git a/build/internal/release_impl_official.scons b/build/internal/release_impl_official.scons new file mode 100644 index 0000000..982f0636 --- /dev/null +++ b/build/internal/release_impl_official.scons @@ -0,0 +1,30 @@ +# 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__ = """ +Release settings for official Chromium builds. +""" + +Import("env") + +env.ApplySConscript(['release_defaults.scons']) + +if env.Bit('windows'): + env.Append( + ARFLAGS = [ + '/ltcg', + ], + CCFLAGS = [ + '/Ox', # VCCLCompilerTool.Optimization="3" + '/Ob2', # VCCLCompilerTool.InlineFunctionExpansion="2" + '/Oi', # VCCLCompilerTool.EnableIntrinsicFunctions="true" + '/Os', # VCCLCompilerTool.FavorSizeOrSpeed="2" + '/Ox', # VCCLCompilerTool.OmitFramePointers="true" + '/GT', # VCCLCompilerTool.EnableFiberSafeOptimizations="true" + '/GL', # VCCLCompilerTool.WholeProgramOptimization="true" + ] + LINKFLAGS = [ + '/LTCG', # VCLinkerTool.LinkTimeCodeGeneration="1" + ], + ) diff --git a/build/internal/release_impl_purify.scons b/build/internal/release_impl_purify.scons new file mode 100644 index 0000000..1a03948 --- /dev/null +++ b/build/internal/release_impl_purify.scons @@ -0,0 +1,29 @@ +# 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__ = """ +Release settings for Chromium builds with Purify. +""" + +Import("env") + +env.ApplySConscript(['release_defaults.scons']) + +env.Append( + CPPDEFINES = [ + 'PURIFY', + ], +) + +if env.Bit('windows'): + env.Append( + CCFLAGS = [ + '/Od', # VCCLCompilerTool.Optimization="0" + '/MT', # VCCLCompilerTool.RuntimeLibrary="0" + '/GS-', # VCCLCompilerTool.BufferSecurityCheck="false" + ] + LINKFLAGS = [ + '/OPT:ICF', # VCLinkerTool.EnableCOMDATFolding="1" + ], + ) diff --git a/build/release.scons b/build/release.scons new file mode 100644 index 0000000..2d7144e --- /dev/null +++ b/build/release.scons @@ -0,0 +1,18 @@ +# 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__ = """ +Release settings for Chromium builds. + +Incorporates "release_impl" and "chromium_build" settings, +possibly specific versions selected by the $CHROME_BUILD_TYPE +and $CHROMIUM_BUILD variables. +""" + +Import("env") + +env.ApplySConscript([ + 'internal/release_impl${CHROME_BUILD_TYPE}.scons', + 'internal/chromium_build${CHROMIUM_BUILD}.scons', +]) diff --git a/chrome/SConscript b/chrome/SConscript index cdea2c5..848f0e6 100644 --- a/chrome/SConscript +++ b/chrome/SConscript @@ -63,6 +63,10 @@ if env_res['PLATFORM'] == 'win32': env_dll = env.Clone() +env_dll.ApplySConscript([ + '$CHROME_SRC_DIR/build/using_v8.scons', +]) + env_dll.Prepend( CPPPATH = [ "..", @@ -135,8 +139,6 @@ env_dll.Append( #'libevent', 'sqlite', 'views', - #'v8', - 'v8_g', 'v8_snapshot', ], ) diff --git a/chrome/test/interactive_ui/interactive_ui_tests.scons b/chrome/test/interactive_ui/interactive_ui_tests.scons index 5f724f2..e60de9a 100644 --- a/chrome/test/interactive_ui/interactive_ui_tests.scons +++ b/chrome/test/interactive_ui/interactive_ui_tests.scons @@ -13,6 +13,7 @@ env.SConscript([ '$CHROME_DIR/third_party/hunspell/using_hunspell.scons', '$CHROME_DIR/third_party/wtl/using_wtl.scons', '$CHROME_SRC_DIR/build/using_googleurl.scons', + '$CHROME_SRC_DIR/build/using_v8.scons', '$GTEST_DIR/../using_gtest.scons', '$ICU38_DIR/using_icu38.scons', '$LIBJPEG_DIR/using_libjpeg.scons', @@ -54,7 +55,6 @@ env.Prepend( 'test_chrome_plugin', 'util', 'views', - 'v8_g', 'v8_snapshot', 'V8Bindings', 'WebCore', diff --git a/chrome/tools/test/image_diff/image_diff.scons b/chrome/tools/test/image_diff/image_diff.scons index b4d4a9e..540d7a1 100644 --- a/chrome/tools/test/image_diff/image_diff.scons +++ b/chrome/tools/test/image_diff/image_diff.scons @@ -16,9 +16,6 @@ env.ApplySConscript([ ]) env.Prepend( - CPPDEFINES = [ - '_DEBUG', - ], CPPPATH = [ '$CHROME_SRC_DIR', ], diff --git a/net/crash_cache.scons b/net/crash_cache.scons index 4fc90ca..e4ec1d9 100644 --- a/net/crash_cache.scons +++ b/net/crash_cache.scons @@ -10,43 +10,18 @@ Import('env') env = env.Clone() -env.SConscript([ - # On Linux, dependencies must follow dependents, so... - # 1) net must come before base and modp_b64. - '$NET_DIR/using_net.scons', - +env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$GTEST_DIR/../using_gtest.scons', '$ICU38_DIR/using_icu38.scons', -], {'env':env}) - -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], -) + '$NET_DIR/using_net.scons', +]) if env['PLATFORM'] == 'win32': env.Prepend( CCFLAGS = [ - '/TP', '/WX', ], - CPPDEFINES = [ - '_WIN32_WINNT=0x0600', - 'WINVER=0x0600', - '_HAS_EXCEPTIONS=0', - ], - LINKFLAGS = [ - '/DELAYLOAD:"dwmapi.dll"', - '/DELAYLOAD:"uxtheme.dll"', - '/MACHINE:X86', - '/FIXED:No', - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', - ], ) input_files = [ diff --git a/net/net_lib.scons b/net/net_lib.scons index 707216f..818fe14 100644 --- a/net/net_lib.scons +++ b/net/net_lib.scons @@ -8,21 +8,13 @@ Configuration for building net.lib / libnet.a. Import('env') -env_res = env.Clone() -env_tests = env.Clone() env = env.Clone() -env.SConscript([ +env.ApplySConscript([ '$ICU38_DIR/using_icu38.scons', '$SDCH_DIR/using_sdch.scons', '$ZLIB_DIR/using_zlib.scons', -], {'env':env}) - -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], -) +]) # These net files work on *all* platforms; files that don't work # cross-platform live below. diff --git a/net/net_perftests.scons b/net/net_perftests.scons index 1fbc6f1..6c62c99 100644 --- a/net/net_perftests.scons +++ b/net/net_perftests.scons @@ -10,51 +10,25 @@ Import('env') env = env.Clone() -env.SConscript([ - # On Linux, dependencies must follow dependents, so... - # 1) net must come before base and modp_b64. - # 2) bzip2 must come before base. - '$NET_DIR/using_net.scons', - +env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$CHROME_SRC_DIR/build/using_googleurl.scons', '$GTEST_DIR/../using_gtest.scons', '$ICU38_DIR/using_icu38.scons', '$MODP_B64_DIR/using_modp_b64.scons', -], {'env':env}) + '$NET_DIR/using_net.scons', +]) if env['PLATFORM'] in ('posix', 'darwin'): env.SConscript([ '$LIBEVENT_DIR/using_libevent.scons', ], {'env':env}) -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], -) - if env['PLATFORM'] == 'win32': env.Prepend( CCFLAGS = [ - '/TP', '/WX', ], - CPPDEFINES = [ - '_WIN32_WINNT=0x0600', - 'WINVER=0x0600', - '_HAS_EXCEPTIONS=0', - ], - LINKFLAGS = [ - '/DELAYLOAD:"dwmapi.dll"', - '/DELAYLOAD:"uxtheme.dll"', - '/MACHINE:X86', - '/FIXED:No', - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', - ], ) elif env['PLATFORM'] == 'posix': env.Append( diff --git a/net/net_resources.scons b/net/net_resources.scons index 3b25ce2..e884d52 100644 --- a/net/net_resources.scons +++ b/net/net_resources.scons @@ -11,9 +11,6 @@ Import('env') env = env.Clone() env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], RCFLAGS = [ ['/l', '0x409'], ], diff --git a/net/net_unittests.scons b/net/net_unittests.scons index 81293c7..9f6dda8 100644 --- a/net/net_unittests.scons +++ b/net/net_unittests.scons @@ -10,7 +10,7 @@ Import('env') env = env.Clone() -env.SConscript([ +env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$BZIP2_DIR/using_bzip2.scons', '$CHROME_SRC_DIR/build/using_googleurl.scons', @@ -20,41 +20,18 @@ env.SConscript([ '$NET_DIR/using_net.scons', '$SDCH_DIR/using_sdch.scons', '$ZLIB_DIR/using_zlib.scons', -], {'env':env}) +]) if env['PLATFORM'] in ('posix', 'darwin'): env.SConscript([ '$LIBEVENT_DIR/using_libevent.scons', ], {'env':env}) - -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], -) - if env['PLATFORM'] == 'win32': env.Prepend( CCFLAGS = [ - '/TP', '/WX', ], - CPPDEFINES = [ - '_WIN32_WINNT=0x0600', - 'WINVER=0x0600', - '_HAS_EXCEPTIONS=0', - ], - LINKFLAGS = [ - '/DELAYLOAD:"dwmapi.dll"', - '/DELAYLOAD:"uxtheme.dll"', - '/MACHINE:X86', - '/FIXED:No', - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', - ], ) input_files = [ diff --git a/net/stress_cache.scons b/net/stress_cache.scons index 83d976b6..09cd905 100644 --- a/net/stress_cache.scons +++ b/net/stress_cache.scons @@ -10,43 +10,18 @@ Import('env') env = env.Clone() -env.SConscript([ - # On Linux, dependencies must follow dependents, so... - # 1) net must come before base and modp_b64. - '$NET_DIR/using_net.scons', - +env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$GTEST_DIR/../using_gtest.scons', '$ICU38_DIR/using_icu38.scons', -], {'env':env}) - -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], -) + '$NET_DIR/using_net.scons', +]) if env['PLATFORM'] == 'win32': env.Prepend( CCFLAGS = [ - '/TP', '/WX', ], - CPPDEFINES = [ - '_WIN32_WINNT=0x0600', - 'WINVER=0x0600', - '_HAS_EXCEPTIONS=0', - ], - LINKFLAGS = [ - '/DELAYLOAD:"dwmapi.dll"', - '/DELAYLOAD:"uxtheme.dll"', - '/MACHINE:X86', - '/FIXED:No', - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', - ], ) input_files = [ diff --git a/net/tools/tld_cleanup/tld_cleanup.scons b/net/tools/tld_cleanup/tld_cleanup.scons index a8380c2..6b579f0 100644 --- a/net/tools/tld_cleanup/tld_cleanup.scons +++ b/net/tools/tld_cleanup/tld_cleanup.scons @@ -10,38 +10,17 @@ Import('env') env = env.Clone() -env.SConscript([ +env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$CHROME_SRC_DIR/build/using_googleurl.scons', '$ICU38_DIR/using_icu38.scons', '$NET_DIR/using_net.scons', -], {'env':env}) - -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], -) +]) if env['PLATFORM'] == 'win32': env.Append( - CCFLAGS = [ - '/TP', - ], - LINKFLAGS = [ - '/INCREMENTAL', - '/MANIFEST', - '/DELAYLOAD:"dwmapi.dll"', - '/DELAYLOAD:"uxtheme.dll"', - '/DEBUG', '/SUBSYSTEM:CONSOLE', - '/MACHINE:X86', - '/FIXED:No', - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', ], ) diff --git a/sandbox/src/sandbox_lib.scons b/sandbox/src/sandbox_lib.scons index 4232ff8..493f3be 100644 --- a/sandbox/src/sandbox_lib.scons +++ b/sandbox/src/sandbox_lib.scons @@ -6,29 +6,13 @@ Import('env') env = env.Clone() -env.SConscript([ +env.ApplySConscript([ '$GTEST_DIR/../using_gtest.scons', -], {'env':env}) - -# Some of the sandbox sources include "gtest.h", so we need it -# in the base env here, not just in env_tests. -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], - CPPDEFINES = [ - 'CHROMIUM_BUILD', - ], -) +]) if env['PLATFORM'] == 'win32': env.Append( - CPPDEFINES = [ - '_SECURE_ATL', - '_WINDOWS', - ], CCFLAGS = [ - '/TP', '/WX', # treat warnings as errors ], ) diff --git a/sandbox/tests/common/sandbox_common.scons b/sandbox/tests/common/sandbox_common.scons index afd36a0..b1b101c 100644 --- a/sandbox/tests/common/sandbox_common.scons +++ b/sandbox/tests/common/sandbox_common.scons @@ -6,21 +6,8 @@ Import('env') env = env.Clone() -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], - CPPDEFINES = [ - 'CHROMIUM_BUILD', - ], -) - if env['PLATFORM'] == 'win32': env.Append( - CPPDEFINES = [ - '_SECURE_ATL', - '_WINDOWS', - ], CCFLAGS = [ '/WX', # treat warnings as errors ], diff --git a/sandbox/tests/integration_tests/sbox_integration_tests.scons b/sandbox/tests/integration_tests/sbox_integration_tests.scons index ad0f39a..7c8ed97 100644 --- a/sandbox/tests/integration_tests/sbox_integration_tests.scons +++ b/sandbox/tests/integration_tests/sbox_integration_tests.scons @@ -6,48 +6,19 @@ Import('env') env = env.Clone() -env.SConscript([ +env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$GTEST_DIR/../using_gtest.scons', '$SANDBOX_DIR/using_sandbox.scons', -], {'env':env}) - -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], - CPPDEFINES = [ - 'CHROMIUM_BUILD', - ], -) +]) if env['PLATFORM'] == 'win32': env.Append( - CPPDEFINES = [ - '_SECURE_ATL', - '_WINDOWS', - ], CCFLAGS = [ - '/TP', '/WX', # treat warnings as errors ], ) -env.Prepend( - LINKFLAGS = [ - '/DELAYLOAD:dwmapi.dll', - '/DELAYLOAD:uxtheme.dll', - '/MACHINE:X86', - '/FIXED:No', - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', - ], -) - - - # TODO(bradnelson): This step generates integration_tests.pch.ib_tag # SCons doesn't know. env_p = env.Clone() diff --git a/sandbox/tests/unit_tests/sbox_unittests.scons b/sandbox/tests/unit_tests/sbox_unittests.scons index f311ede..02fc1b8 100644 --- a/sandbox/tests/unit_tests/sbox_unittests.scons +++ b/sandbox/tests/unit_tests/sbox_unittests.scons @@ -6,47 +6,19 @@ Import('env') env = env.Clone() -env.SConscript([ +env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$GTEST_DIR/../using_gtest.scons', '$SANDBOX_DIR/using_sandbox.scons', -], {'env':env}) - -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], - CPPDEFINES = [ - 'CHROMIUM_BUILD', - ], -) +]) if env['PLATFORM'] == 'win32': env.Append( - CPPDEFINES = [ - '_SECURE_ATL', - '_WINDOWS', - ], CCFLAGS = [ - '/TP', '/WX', # treat warnings as errors ], ) -env.Prepend( - LINKFLAGS = [ - '/DELAYLOAD:dwmapi.dll', - '/DELAYLOAD:uxtheme.dll', - '/MACHINE:X86', - '/FIXED:No', - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', - ], -) - - # TODO(bradnelson): This step generates unittests_tests.pch.ib_tag # SCons doesn't know. env_p = env.Clone() diff --git a/sandbox/tests/validation_tests/sbox_validation_tests.scons b/sandbox/tests/validation_tests/sbox_validation_tests.scons index 7320034..ba4dcae 100644 --- a/sandbox/tests/validation_tests/sbox_validation_tests.scons +++ b/sandbox/tests/validation_tests/sbox_validation_tests.scons @@ -6,44 +6,20 @@ Import('env') env = env.Clone() -env.SConscript([ +env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$GTEST_DIR/../using_gtest.scons', '$SANDBOX_DIR/using_sandbox.scons', -], {'env':env}) - -env.Prepend( - CPPPATH = [ - '$CHROME_SRC_DIR', - ], - CPPDEFINES = [ - 'CHROMIUM_BUILD', - ], -) +]) if env['PLATFORM'] == 'win32': env.Append( - CPPDEFINES = [ - '_SECURE_ATL', - '_WINDOWS', - ], CCFLAGS = [ - '/TP', '/WX', # treat warnings as errors ], ) env.Prepend( - LINKFLAGS = [ - '/DELAYLOAD:dwmapi.dll', - '/DELAYLOAD:uxtheme.dll', - '/MACHINE:X86', - '/FIXED:No', - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', - ], LIBS = [ 'shlwapi', ], diff --git a/webkit/SConscript b/webkit/SConscript index f6924bf..08b05fe 100644 --- a/webkit/SConscript +++ b/webkit/SConscript @@ -240,8 +240,6 @@ if env['PLATFORM'] == 'win32': '_CRT_NONSTDC_NO_WARNINGS', '_CRT_NONSTDC_NO_DEPRECATE', ['CRASH', '__debugbreak'], - '_WIN32_WINNT=0x0600', - 'WINVER=0x0600', ]) env.Prepend( diff --git a/webkit/build/JavaScriptCore/SConscript b/webkit/build/JavaScriptCore/SConscript index 4df5559..768d3af 100644 --- a/webkit/build/JavaScriptCore/SConscript +++ b/webkit/build/JavaScriptCore/SConscript @@ -131,8 +131,6 @@ if env['PLATFORM'] == 'win32': ], CPPDEFINES = [ 'CRASH=__debugbreak', - '_WIN32_WINNT=0x0600', - 'WINVER=0x0600', ], CCFLAGS = [ '/TP', |