diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-16 22:24:55 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-16 22:24:55 +0000 |
commit | e16027d6b660ac4c0d9b50e7dabbf03d7cf1ba5f (patch) | |
tree | b265b4cef18b6e708dcf36015c1afb8220aea648 | |
parent | 4ed077a820dca166e3e2bf9785311331df0190b0 (diff) | |
download | chromium_src-e16027d6b660ac4c0d9b50e7dabbf03d7cf1ba5f.zip chromium_src-e16027d6b660ac4c0d9b50e7dabbf03d7cf1ba5f.tar.gz chromium_src-e16027d6b660ac4c0d9b50e7dabbf03d7cf1ba5f.tar.bz2 |
Fix accumulated webkit merge ramifications in the SCons build of Chrome
(plus various renaming ripple effects masked by merge build errors):
* Move invocation of recently-created *.scons files from
chrome\SConscript into chrome\chrome.scons.
* Move the ChromeVersionRC() Builder up into chrome\chrome.scons
so it's available in all the newer *.scons files (specifically
installer\mini_installer\mini_installer.scons and
installer\setup\setup.scons).
* Build chrome.dll in a chrome_dll subdirectory, and chrome.exe in
a chrome_exe subdirectory, to avoid the name conflict when both
try to create a chrome.lib library as part of linking. Re-name
them to chrome.{dll,lib,exe} on installation into $DESTINATION_ROOT.
* Install underneath Hammer\ ($DESTINATION_ROOT) copies of:
themes\default.dll
* Portability: link against 'chrome' and 'common' from the LIBS variable,
not by explicitly listing 'chrome.lib' and 'common.lib'.
* Link interactive_ui_tests.exe links against sdch, not google_update,
and add CPPPATH directories for included resource files.
* Install a number of necessary ancillary files in explicitly in
$DESTINATION_ROOT, not $TARGET_ROOT: chrome.dll, icudt38.dll, rlz.dll,
"First Run", themes\*, locales\, Dictionaries.
* Add a 'chrome_locales' Alias for the locale .dll files installed
into the locales\ subdirectory, and use Requires() to make sure
they're installed for chrome.exe regardless of what target is used.
* Add a 'chrome_Dictionaries' Alias for the hunspell dictionaries
into the Dictionaries\ subdirectory, and use Requires() to make sure
they're installed for chrome.exe regardless of what target is used.
* Clone() the automated_ui_tests.scons construction environment so its
settings don't pollute builds of other targets.
* Add explicit dependencies on various generated .rc files (with
TODO(sgk) to figure out why they're not picked up by the
implicit dependency scan).
Review URL: http://codereview.chromium.org/10976
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5549 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/SConscript | 83 | ||||
-rw-r--r-- | chrome/app/resources/SConscript | 4 | ||||
-rw-r--r-- | chrome/app/theme/SConscript | 4 | ||||
-rw-r--r-- | chrome/chrome.scons | 61 | ||||
-rw-r--r-- | chrome/installer/mini_installer/mini_installer.scons | 24 | ||||
-rw-r--r-- | chrome/installer/setup/setup.scons | 21 | ||||
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_tests.scons | 2 | ||||
-rw-r--r-- | chrome/test/interactive_ui/interactive_ui_tests.scons | 5 | ||||
-rw-r--r-- | chrome/third_party/hunspell/SConscript | 4 |
9 files changed, 122 insertions, 86 deletions
diff --git a/chrome/SConscript b/chrome/SConscript index f136a22..cdea2c5 100644 --- a/chrome/SConscript +++ b/chrome/SConscript @@ -226,7 +226,7 @@ grit_files.extend(google_chrome) # TODO(port) if env_dll['PLATFORM'] == 'win32': - dll_targets = env_dll.ChromeSharedLibrary('chrome.dll', + dll_targets = env_dll.ChromeSharedLibrary('chrome_dll/chrome', dll_resources + input_files, PDB='chrome_dll.pdb') install_targets.extend(dll_targets) @@ -234,27 +234,6 @@ if env_dll['PLATFORM'] == 'win32': for g in [ g for g in grit_files if str(g).endswith('.rc') ]: env_res.RES(g) - def chrome_version_emitter(target, source, env): - source.append(env.File('$CHROME_SRC_DIR/chrome/VERSION')) - # TODO(sgk): parameterize for chromium-vs.-google_chrome - source.append(env.File('$CHROME_SRC_DIR/chrome/app/theme/google_chrome/BRANDING')) - return target, source - - b = Builder(action = '$CHROME_VERSION_RC_COM', - emitter = chrome_version_emitter) - - env['BUILDERS']['ChromeVersionRC'] = b - - env.Replace( - # NOTE: the / after $CHROME_SRC_DIR/chrome/ is required because - # version.bat assumes a path with a trailing slash. - CHROME_VERSION_RC_COM = - '$VERSION_BAT $SOURCE $CHROME_SRC_DIR/chrome/ $PWD $TARGET', - VERSION_BAT = env.File( - '$CHROME_SRC_DIR/chrome/tools/build/win/version.bat'), - PWD = Dir('.'), - ) - chrome_exe_version_rc = env.ChromeVersionRC( 'chrome_exe_version.rc', 'app/chrome_exe_version.rc.version' @@ -290,6 +269,8 @@ env_exe.Prepend( LIBS = [ 'base', 'breakpad_handler', + 'chrome', + 'common', 'icu', 'sandbox', 'util', @@ -320,27 +301,29 @@ env_exe.Append( # TODO(port) if env['PLATFORM'] == 'win32': chrome_exe = env_exe.ChromeProgram( - 'chrome', + 'chrome_exe/chrome', [ chrome_exe_res, 'app/breakpad.cc', 'app/chrome_exe_main.cc', 'app/client_util.cc', 'app/google_update_client.cc', - - 'common/common.lib', - 'chrome.lib', ] ) - install_targets.extend(chrome_exe) - env.Requires(chrome_exe[0], ['$TARGET_ROOT/chrome.dll', - '$TARGET_ROOT/icudt38.dll', - '$TARGET_ROOT/rlz.dll', - '$TARGET_ROOT/First Run']) + install_targets.append(chrome_exe[0]) - env.Command('$TARGET_ROOT/First Run', '$CHROME_DIR/app/FirstRun', - Copy('$TARGET', '$SOURCE')) + env.Requires('$DESTINATION_ROOT/chrome.exe', + ['$DESTINATION_ROOT/chrome.dll', + '$DESTINATION_ROOT/icudt38.dll', + '$DESTINATION_ROOT/rlz.dll', + '$DESTINATION_ROOT/First Run', + '$DESTINATION_ROOT/themes', + Alias('chrome_locales'), + Alias('chrome_Dictionaries'), + ]) + + env.Install('$DESTINATION_ROOT', '$CHROME_DIR/app/FirstRun') # For release we want to run dependencies.py, may look something like: #env.AddPostAction('$TARGET_ROOT/chrome.exe', @@ -394,10 +377,7 @@ if env_flat['PLATFORM'] == 'win32': env_test.Object('test/test_file_util.cc', CPPPATH=['..'] + env['CPPPATH']) -sconscript_files = [ - 'test/chrome_plugin/test_chrome_plugin.scons', - 'tools/test/image_diff/image_diff.scons', -] +sconscript_files = [] if not env.WantSystemLib('hunspell'): sconscript_files.append('third_party/hunspell/SConscript') @@ -410,23 +390,6 @@ if env['PLATFORM'] == 'win32': 'app/resources/SConscript', 'app/theme/SConscript', 'browser/views/SConscript', - 'installer/mini_installer/mini_installer.scons', - 'installer/mini_installer/installer_unittests.scons', - 'installer/setup/setup.scons', - 'installer/util/util.scons', - 'test/activex_test_control/activex_test_control.scons', - 'test/automation/automation.scons', - 'test/memory_test/memory_test.scons', - 'test/mini_installer_test/mini_installer_test.scons', - 'test/page_cycler/page_cycler_tests.scons', - 'test/plugin/plugin_tests.scons', - 'test/reliability/reliability_tests.scons', - 'test/security_tests/security_tests.scons', - 'test/selenium/selenium_tests.scons', - 'test/startup/startup_tests.scons', - 'test/tab_switching/tab_switching_test.scons', - 'tools/crash_service/crash_service.scons', - 'tools/perf/flush_cache/flush_cache.scons', 'views/SConscript', ]) @@ -438,8 +401,7 @@ if env['PLATFORM'] == 'win32': '$WEBKIT_DIR/JavaScriptCore_pcre.lib') -i = env.Install('$TARGET_ROOT', install_targets) -env.Alias('chrome', i) +env.Install('$DESTINATION_ROOT', install_targets) gears_plugins = [ @@ -449,14 +411,9 @@ gears_plugins = [ # TODO(port) if env['PLATFORM'] == 'win32': - i = env.Install('$TARGET_ROOT/plugins/gears', gears_plugins) - env.Alias('chrome', i) + env.Install('$DESTINATION_ROOT/plugins/gears', gears_plugins) - -i = env.Command('$TARGET_ROOT/resources/inspector', +env.Command('$DESTINATION_ROOT/resources/inspector', '$CHROME_SRC_DIR/webkit/port/page/inspector', Copy('$TARGET', '$SOURCE'), source_scanner=DirScanner) -env.Alias('chrome', i) - -env.Alias('chrome', env.Alias('webkit')) diff --git a/chrome/app/resources/SConscript b/chrome/app/resources/SConscript index b9ed420..8e06d92 100644 --- a/chrome/app/resources/SConscript +++ b/chrome/app/resources/SConscript @@ -118,5 +118,5 @@ for locale_settings_res in resources: locale_dlls.append(dll) -i = env.Install('$TARGET_ROOT/locales/', locale_dlls) -env.Alias('chrome', i) +i = env.Install('$DESTINATION_ROOT/locales/', locale_dlls) +env.Alias('chrome_locales', i) diff --git a/chrome/app/theme/SConscript b/chrome/app/theme/SConscript index 1f2c9c4..30857ed 100644 --- a/chrome/app/theme/SConscript +++ b/chrome/app/theme/SConscript @@ -43,9 +43,7 @@ env.Append( ) themes_default = env.ChromeSharedLibrary("default", res) +env.Install("$DESTINATION_ROOT/themes", themes_default) # TODO(bradnelson): figure out why this was needed #env.AddPostAction(themes_default[1], Touch(themes_default[1:])) - -i = env.Install("$TARGET_ROOT/themes", themes_default) -env.Alias('chrome', i) diff --git a/chrome/chrome.scons b/chrome/chrome.scons index 57ff9aa..5a8b4ab 100644 --- a/chrome/chrome.scons +++ b/chrome/chrome.scons @@ -14,6 +14,30 @@ env.Append( COMPONENT_TEST_PROGRAM_GROUPS = ['chrome'], ) + +# TODO(sgk): move the ChromeVersionRC builder into a Tool module +def chrome_version_emitter(target, source, env): + source.append(env.File('$CHROME_SRC_DIR/chrome/VERSION')) + # TODO(sgk): parameterize for chromium-vs.-google_chrome + source.append(env.File('$CHROME_SRC_DIR/chrome/app/theme/google_chrome/BRANDING')) + return target, source + +b = Builder(action = '$CHROME_VERSION_RC_COM', + emitter = chrome_version_emitter) + +env['BUILDERS']['ChromeVersionRC'] = b + +env.Replace( + # NOTE: the / after $CHROME_SRC_DIR/chrome/ is required because + # version.bat assumes a path with a trailing slash. + CHROME_VERSION_RC_COM = + '$VERSION_BAT $SOURCE $CHROME_SRC_DIR/chrome/ $PWD $TARGET', + VERSION_BAT = env.File( + '$CHROME_SRC_DIR/chrome/tools/build/win/version.bat'), + PWD = Dir('.'), +) + + sconscript_files = [ 'SConscript', @@ -21,20 +45,57 @@ sconscript_files = [ 'browser/debugger/debugger.scons', 'common/common.scons', 'common/ipc_tests.scons', + 'installer/mini_installer/installer_unittests.scons', + 'installer/mini_installer/mini_installer.scons', + 'installer/setup/setup.scons', + 'installer/util/util.scons', 'plugin/plugin.scons', 'renderer/renderer.scons', + 'test/activex_test_control/activex_test_control.scons', 'test/automated_ui_tests/automated_ui_tests.scons', + 'test/automation/automation.scons', + 'test/chrome_plugin/test_chrome_plugin.scons', 'test/interactive_ui/interactive_ui_tests.scons', + 'test/memory_test/memory_test.scons', + 'test/mini_installer_test/mini_installer_test.scons', + 'test/page_cycler/page_cycler_tests.scons', + 'test/plugin/plugin_tests.scons', + 'test/reliability/reliability_tests.scons', + 'test/security_tests/security_tests.scons', + 'test/selenium/selenium_tests.scons', + 'test/startup/startup_tests.scons', + 'test/tab_switching/tab_switching_test.scons', 'test/ui/ui_tests.scons', 'test/unit/unit_tests.scons', + 'tools/crash_service/crash_service.scons', + 'tools/perf/flush_cache/flush_cache.scons', + 'tools/test/image_diff/image_diff.scons', ] +# TODO(port) if env['PLATFORM'] != 'win32': remove_files = [ 'browser/debugger/debugger.scons', + 'installer/mini_installer/installer_unittests.scons', + 'installer/mini_installer/mini_installer.scons', + 'installer/setup/setup.scons', + 'installer/util/util.scons', + 'test/activex_test_control/activex_test_control.scons', 'test/automated_ui_tests/automated_ui_tests.scons', + 'test/automation/automation.scons', 'test/interactive_ui/interactive_ui_tests.scons', + 'test/memory_test/memory_test.scons', + 'test/mini_installer_test/mini_installer_test.scons', + 'test/page_cycler/page_cycler_tests.scons', + 'test/plugin/plugin_tests.scons', + 'test/reliability/reliability_tests.scons', + 'test/security_tests/security_tests.scons', + 'test/selenium/selenium_tests.scons', + 'test/startup/startup_tests.scons', + 'test/tab_switching/tab_switching_test.scons', 'test/ui/ui_tests.scons', + 'tools/crash_service/crash_service.scons', + 'tools/perf/flush_cache/flush_cache.scons', ] for remove in remove_files: sconscript_files.remove(remove) diff --git a/chrome/installer/mini_installer/mini_installer.scons b/chrome/installer/mini_installer/mini_installer.scons index a6b5dc4..f9d0dd2 100644 --- a/chrome/installer/mini_installer/mini_installer.scons +++ b/chrome/installer/mini_installer/mini_installer.scons @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -Import('env', 'env_res') +Import('env') env = env.Clone() @@ -17,11 +17,11 @@ env.ApplySConscript([ # obviously windows-specific things if env['PLATFORM'] == 'win32': - env_res = env_res.Clone() + env_res = env.Clone() env_res.Append( CPPPATH = [ - "$TARGET_ROOT", + "$DESTINATION_ROOT", ".", "$CHROME_SRC_DIR", ], @@ -92,15 +92,23 @@ env.ChromeProgram('mini_installer', input_files) env.AppendENVPath('PATH', r'C:\WINDOWS\system32') -packed = env.Command('$TARGET_ROOT/packed_files.txt', +packed = env.Command('$DESTINATION_ROOT/packed_files.txt', ['$CHROME_DIR/tools/build/win/create_installer_archive.py', '$CHROME_DIR/installer/mini_installer/chrome.release'], ('$PYTHON ${SOURCES[0]}' ' --output_dir=${TARGET.dir}' ' --input_file=${SOURCES[1]}')) -env.Depends(packed, '$TARGET_ROOT/setup.exe') +env.Depends(packed, '$DESTINATION_ROOT/setup.exe') +# mini_installer.rc depends on the generated packed_files.txt +# TODO(sgk): implicit dependency should be picked up automatically +env.Depends(resources, packed) -env.ChromeVersionRC('mini_installer_exe_version.rc', - 'mini_installer_exe_version.rc.version', - PWD=Dir('.')) + +exe_version_rc = env.ChromeVersionRC('mini_installer_exe_version.rc', + 'mini_installer_exe_version.rc.version', + PWD=Dir('.')) + +if env['PLATFORM'] == 'win32': + # TODO(sgk): implicit dependency should be picked up automatically + env_res.Depends(resources, exe_version_rc) diff --git a/chrome/installer/setup/setup.scons b/chrome/installer/setup/setup.scons index 5ea69e5..1a73359 100644 --- a/chrome/installer/setup/setup.scons +++ b/chrome/installer/setup/setup.scons @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -Import('env', 'env_res') +Import('env') env = env.Clone() @@ -14,13 +14,13 @@ env.ApplySConscript([ ]) if env['PLATFORM'] == 'win32': - env_res = env_res.Clone() + env_res = env.Clone() env_res.Append( CPPPATH = [ - "$TARGET_ROOT", ".", "$CHROME_SRC_DIR", + "$CHROME_DIR/installer/util", ], RCFLAGS = [ ["/l", "0x409"], @@ -29,11 +29,14 @@ if env['PLATFORM'] == 'win32': resources = env_res.RES('setup.rc') + # TODO(sgk): implicit dependency should be picked up automatically + env_res.Depends(resources, + '$CHROME_DIR/installer/util/installer_util_strings.rc') + env.Prepend( CPPPATH = [ '../util', - '$TARGET_ROOT', '.', '$CHROME_SRC_DIR', ], @@ -80,6 +83,10 @@ input_files = [ env.ChromeProgram('setup', resources + input_files) -env.ChromeVersionRC('setup_exe_version.rc', - 'setup_exe_version.rc.version', - PWD = env.Dir('.')) +exe_version_rc = env.ChromeVersionRC('setup_exe_version.rc', + 'setup_exe_version.rc.version', + PWD = env.Dir('.')) + +if env['PLATFORM'] == 'win32': + # TODO(sgk): implicit dependency should be picked up automatically + env_res.Depends(resources, exe_version_rc) diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.scons b/chrome/test/automated_ui_tests/automated_ui_tests.scons index 27a4517f..659d398 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.scons +++ b/chrome/test/automated_ui_tests/automated_ui_tests.scons @@ -4,6 +4,8 @@ Import('env') +env = env.Clone() + env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$BASE_DIR/gfx/using_base_gfx.scons', diff --git a/chrome/test/interactive_ui/interactive_ui_tests.scons b/chrome/test/interactive_ui/interactive_ui_tests.scons index 5163fa3..5f724f2 100644 --- a/chrome/test/interactive_ui/interactive_ui_tests.scons +++ b/chrome/test/interactive_ui/interactive_ui_tests.scons @@ -13,7 +13,6 @@ 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', - '$GOOGLE_UPDATE_DIR/using_google_update.scons', '$GTEST_DIR/../using_gtest.scons', '$ICU38_DIR/using_icu38.scons', '$LIBJPEG_DIR/using_libjpeg.scons', @@ -23,6 +22,7 @@ env.SConscript([ '$MODP_B64_DIR/using_modp_b64.scons', '$NET_DIR/using_net.scons', '$NPAPI_DIR/using_npapi.scons', + '$SDCH_DIR/using_sdch.scons', '$SKIA_DIR/using_skia.scons', '$ZLIB_DIR/using_zlib.scons', ], {'env':env}) @@ -32,6 +32,9 @@ env.Prepend( 'UI_TEST', ], CPPPATH = [ + '$CHROME_DIR/app', + # For generated_resources.h + '$CHROME_DIR/app/resources', '$CHROME_SRC_DIR', ], LIBS = [ diff --git a/chrome/third_party/hunspell/SConscript b/chrome/third_party/hunspell/SConscript index 1c6b96e..5c76531 100644 --- a/chrome/third_party/hunspell/SConscript +++ b/chrome/third_party/hunspell/SConscript @@ -92,5 +92,5 @@ dictionaries = [ 'dictionaries/en-US.aff', ] -i = env.Install('$TARGET_ROOT/Dictionaries', dictionaries) -env.Alias('chrome', i) +i = env.Install('$DESTINATION_ROOT/Dictionaries', dictionaries) +env.Alias('chrome_Dictionaries', i) |