| OLD | NEW |
| 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 import shutil | 6 import shutil |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 | 9 |
| 10 p = ARGUMENTS.get('PROGRESS') | 10 p = ARGUMENTS.get('PROGRESS') |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 # Where ComponentLibrary() will build libraries. | 42 # Where ComponentLibrary() will build libraries. |
| 43 LIBS_DIR = '$COMPONENT_LIBRARY_DIR', | 43 LIBS_DIR = '$COMPONENT_LIBRARY_DIR', |
| 44 | 44 |
| 45 # TODO(hammer): when Hammer supports this... | 45 # TODO(hammer): when Hammer supports this... |
| 46 # Have Hammer prefix all Library aliases with lib_ (to avoid | 46 # Have Hammer prefix all Library aliases with lib_ (to avoid |
| 47 # collisions with the component names themselves). | 47 # collisions with the component names themselves). |
| 48 #COMPONENT_LIBRARY_ALIAS = 'lib_$LIBNAME', | 48 #COMPONENT_LIBRARY_ALIAS = 'lib_$LIBNAME', |
| 49 | 49 |
| 50 # Disable running of tests thru scons for now. | 50 # Disable running of tests thru scons for now. |
| 51 COMPONENT_TEST_CMDLINE = '', | 51 COMPONENT_TEST_RUNNABLE = False, |
| 52 | 52 |
| 53 BASE_DIR = '$OBJ_ROOT/base', | 53 BASE_DIR = '$OBJ_ROOT/base', |
| 54 BREAKPAD_DIR = '$OBJ_ROOT/breakpad', | 54 BREAKPAD_DIR = '$OBJ_ROOT/breakpad', |
| 55 CHROME_DIR = '$OBJ_ROOT/chrome', | 55 CHROME_DIR = '$OBJ_ROOT/chrome', |
| 56 GEARS_DIR = '$OBJ_ROOT/gears', | 56 GEARS_DIR = '$OBJ_ROOT/gears', |
| 57 GOOGLE_UPDATE_DIR = '$OBJ_ROOT/google_update', | 57 GOOGLE_UPDATE_DIR = '$OBJ_ROOT/google_update', |
| 58 GOOGLEURL_DIR = '$OBJ_ROOT/googleurl', | 58 GOOGLEURL_DIR = '$OBJ_ROOT/googleurl', |
| 59 NET_DIR = '$OBJ_ROOT/net', | 59 NET_DIR = '$OBJ_ROOT/net', |
| 60 RLZ_DIR = '$OBJ_ROOT/rlz', | 60 RLZ_DIR = '$OBJ_ROOT/rlz', |
| 61 SANDBOX_DIR = '$OBJ_ROOT/sandbox', | 61 SANDBOX_DIR = '$OBJ_ROOT/sandbox', |
| (...skipping 27 matching lines...) Expand all Loading... |
| 89 PERL = 'perl', | 89 PERL = 'perl', |
| 90 PERL_INCLUDE_FLAG = '-I ', | 90 PERL_INCLUDE_FLAG = '-I ', |
| 91 PERL_INCLUDE_SUFFIX = '', | 91 PERL_INCLUDE_SUFFIX = '', |
| 92 _PERL_INCLUDE_FLAGS = ('${_concat(PERL_INCLUDE_FLAG, ' | 92 _PERL_INCLUDE_FLAGS = ('${_concat(PERL_INCLUDE_FLAG, ' |
| 93 'PERL_INCLUDE_PATH, ' | 93 'PERL_INCLUDE_PATH, ' |
| 94 'PERL_INCLUDE_SUFFIX,' | 94 'PERL_INCLUDE_SUFFIX,' |
| 95 '__env__, RDirs, TARGET, SOURCE)}'), | 95 '__env__, RDirs, TARGET, SOURCE)}'), |
| 96 ) | 96 ) |
| 97 | 97 |
| 98 | 98 |
| 99 # Declare a bit to gate solution generation. | |
| 100 # The actual generation must be at the end. | |
| 101 DeclareBit('solution', 'Generate a solution file') | |
| 102 root_env.SetBitFromOption('solution', False) | |
| 103 | |
| 104 | |
| 105 def ChromeProgram(env, *args, **kw): | 99 def ChromeProgram(env, *args, **kw): |
| 106 return env.ComponentProgram(*args, **kw) | 100 return env.ComponentProgram(*args, **kw) |
| 107 root_env.AddMethod(ChromeProgram) | 101 root_env.AddMethod(ChromeProgram) |
| 108 | 102 |
| 109 def ChromeTestProgram(env, *args, **kw): | 103 def ChromeTestProgram(env, *args, **kw): |
| 110 return env.ComponentTestProgram(*args, **kw) | 104 return env.ComponentTestProgram(*args, **kw) |
| 111 root_env.AddMethod(ChromeTestProgram) | 105 root_env.AddMethod(ChromeTestProgram) |
| 112 | 106 |
| 113 def ChromeStaticLibrary(env, *args, **kw): | 107 def ChromeStaticLibrary(env, *args, **kw): |
| 114 kw['COMPONENT_STATIC'] = True | 108 kw['COMPONENT_STATIC'] = True |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 # googleurl comes from a different repository so we provide the SConscript | 188 # googleurl comes from a different repository so we provide the SConscript |
| 195 # file. | 189 # file. |
| 196 sconscripts.append('$GOOGLEURL_DIR/googleurl.scons') | 190 sconscripts.append('$GOOGLEURL_DIR/googleurl.scons') |
| 197 | 191 |
| 198 if LoadComponent('net'): | 192 if LoadComponent('net'): |
| 199 sconscripts.append('$NET_DIR/net.scons') | 193 sconscripts.append('$NET_DIR/net.scons') |
| 200 | 194 |
| 201 if LoadComponent('rlz'): | 195 if LoadComponent('rlz'): |
| 202 sconscripts.append('$RLZ_DIR/SConscript') | 196 sconscripts.append('$RLZ_DIR/SConscript') |
| 203 | 197 |
| 204 # TODO(bradnelson): fix solution generation for sandbox. | 198 if LoadComponent('sandbox'): |
| 205 # The solution generator blows up on some of the tests in sandbox. | |
| 206 # For now, disable sandbox for solution generation. | |
| 207 if LoadComponent('sandbox') and not root_env.Bit('solution'): | |
| 208 sconscripts.append('$SANDBOX_DIR/sandbox.scons') | 199 sconscripts.append('$SANDBOX_DIR/sandbox.scons') |
| 209 | 200 |
| 210 if LoadComponent('sdch'): | 201 if LoadComponent('sdch'): |
| 211 sconscripts.append('$SDCH_DIR/SConscript') | 202 sconscripts.append('$SDCH_DIR/SConscript') |
| 212 | 203 |
| 213 if LoadComponent('skia'): | 204 if LoadComponent('skia'): |
| 214 sconscripts.append('$SKIA_DIR/SConscript') | 205 sconscripts.append('$SKIA_DIR/SConscript') |
| 215 | 206 |
| 216 if LoadComponent('testing'): | 207 if LoadComponent('testing'): |
| 217 sconscripts.append('$TESTING_DIR/SConscript.gtest') | 208 sconscripts.append('$TESTING_DIR/SConscript.gtest') |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 # ------------------------------------------------------------------------- | 659 # ------------------------------------------------------------------------- |
| 669 | 660 |
| 670 # Invoke all the SConscripts in each of the environments that make sense on | 661 # Invoke all the SConscripts in each of the environments that make sense on |
| 671 # this host-platform. | 662 # this host-platform. |
| 672 BuildComponents(environment_list) | 663 BuildComponents(environment_list) |
| 673 | 664 |
| 674 # ------------------------------------------------------------------------- | 665 # ------------------------------------------------------------------------- |
| 675 | 666 |
| 676 # This must occur after BuildComponents so that the dependency graph | 667 # This must occur after BuildComponents so that the dependency graph |
| 677 # will be populated. | 668 # will be populated. |
| 678 if root_env.Bit('solution'): | 669 vs_env = windows_env.Clone() |
| 679 solution_env = root_env.Clone(tools = ['visual_studio_solution']) | 670 vs_env.Append(COMPONENT_VS_SOURCE_SUFFIXES = [ |
| 680 src_solution = solution_env.Solution( | 671 '.def', |
| 681 '$MAIN_DIR/chrome_scons_src', [windows_env], | 672 '.ini', |
| 682 exclude_pattern = '.*(Program Files|platformsdk_vista_6_0|cygwin).*', | 673 '.txt', |
| 683 ) | 674 '.ui', |
| 675 '.xml', |
| 676 ]) |
| 677 # Source project |
| 678 p = vs_env.ComponentVSDirProject( |
| 679 'chrome_src', |
| 680 [ |
| 681 # TODO(bradnelson): need to make sure we can use $CHROME_SRC_DIR here |
| 682 '$CHROME_SRC_DIR/base', |
| 683 '$CHROME_SRC_DIR/breakpad', |
| 684 '$CHROME_SRC_DIR/build', |
| 685 # '$CHROME_SRC_DIR/chrome', |
| 686 '.', |
| 687 '$CHROME_SRC_DIR/data', |
| 688 '$CHROME_SRC_DIR/gears', |
| 689 '$CHROME_SRC_DIR/google_update', |
| 690 '$CHROME_SRC_DIR/googleurl', |
| 691 '$CHROME_SRC_DIR/net', |
| 692 '$CHROME_SRC_DIR/rlz', |
| 693 '$CHROME_SRC_DIR/sandbox', |
| 694 '$CHROME_SRC_DIR/sdhc', |
| 695 '$CHROME_SRC_DIR/site_scons', |
| 696 '$CHROME_SRC_DIR/skia', |
| 697 '$CHROME_SRC_DIR/testing', |
| 698 '$CHROME_SRC_DIR/third_party', |
| 699 '$CHROME_SRC_DIR/tools', |
| 700 '$CHROME_SRC_DIR/v8', |
| 701 '$CHROME_SRC_DIR/webkit', |
| 702 ], |
| 703 COMPONENT_VS_SOURCE_FOLDERS = [ |
| 704 (None, '$DESTINATION_ROOT'), |
| 705 ('src', '$CHROME_SRC_DIR'), |
| 706 ], |
| 707 ) |
| 684 | 708 |
| 685 solution = windows_env.ComponentVSSolution('chrome_scons', | 709 vs_env.ComponentVSSolution( |
| 686 [ | 710 'chrome_solution', |
| 687 'all_libraries', | 711 [ |
| 688 'all_programs', | 712 'all_libraries', |
| 689 'all_test_programs', | 713 'all_languages', |
| 690 ], | 714 'all_programs', |
| 691 projects = [windows_env.File('$MAIN_DIR/chrome_scons_src.vcproj')], | 715 'all_test_programs', |
| 692 COMPONENT_VS_SOLUTION_DIR='$MAIN_DIR', | 716 ], projects = [p], |
| 693 COMPONENT_VS_PROJECT_DIR='$MAIN_DIR/projects', | 717 COMPONENT_VS_PROJECT_SCRIPT_PATH=( |
| 694 COMPONENT_VS_PROJECT_SCRIPT_PATH=( | |
| 695 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), | 718 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), |
| 696 ) | 719 ) |
| 697 | |
| 698 Default(None) # Delete all other default targets. | |
| 699 Default([src_solution, solution]) # Build just the solution. | |
| 700 | 720 |
| 701 # ------------------------------------------------------------------------- | 721 # ------------------------------------------------------------------------- |
| OLD | NEW |