| 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 if sys.platform == 'win32': | 10 if sys.platform == 'win32': |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 windows_opt = windows_env.Clone() | 372 windows_opt = windows_env.Clone() |
| 373 environment_list.append(windows_opt) | 373 environment_list.append(windows_opt) |
| 374 windows_opt.Replace( | 374 windows_opt.Replace( |
| 375 BUILD_TYPE = 'opt', | 375 BUILD_TYPE = 'opt', |
| 376 BUILD_TYPE_DESCRIPTION = 'Windows optimized build', | 376 BUILD_TYPE_DESCRIPTION = 'Windows optimized build', |
| 377 ) | 377 ) |
| 378 windows_opt.Tool('target_optimized') | 378 windows_opt.Tool('target_optimized') |
| 379 windows_opt.ApplySConscript(['$CHROME_SRC_DIR/build/release.scons']) | 379 windows_opt.ApplySConscript(['$CHROME_SRC_DIR/build/release.scons']) |
| 380 | 380 |
| 381 # -------------------------------------------------------------------------- | 381 # -------------------------------------------------------------------------- |
| 382 # Platform-independent "msvs" mode for generating Visual Studio |
| 383 # project and solution files from any platform. |
| 384 |
| 385 DeclareBit('msvs', 'Generate Visual Studio files') |
| 386 |
| 387 msvs_env = windows_env.Clone() |
| 388 |
| 389 msvs_env.Tool('target_platform_windows') |
| 390 msvs_env.Tool('component_targets_msvs') # Per target project support. |
| 391 |
| 392 del msvs_env['BUILDERS']['MSVSProject'] |
| 393 del msvs_env['BUILDERS']['MSVSSolution'] |
| 394 msvs_env.Tool('MSVSNew') |
| 395 |
| 396 msvs_env.Tool('midl') |
| 397 |
| 398 environment_list.append(msvs_env) |
| 399 msvs_env.Replace( |
| 400 BUILD_TYPE = 'msvs', |
| 401 BUILD_TYPE_DESCRIPTION = 'Generate Visual Studio files', |
| 402 HOST_PLATFORMS = ['*'], |
| 403 ICU_LIBS = [], |
| 404 ) |
| 405 msvs_env.SetBits('windows', 'msvs') |
| 406 # TODO(sgk): turn into separate debug + release env adding |
| 407 # to a common .sln file |
| 408 msvs_env.Tool('target_debug') |
| 409 |
| 410 # -------------------------------------------------------------------------- |
| 382 # Linux specific | 411 # Linux specific |
| 383 | 412 |
| 384 linux_env = root_env.Clone() | 413 linux_env = root_env.Clone() |
| 385 linux_env.Tool('target_platform_linux') | 414 linux_env.Tool('target_platform_linux') |
| 386 linux_env.Tool('yacc') | 415 linux_env.Tool('yacc') |
| 387 | 416 |
| 388 # By default scons will depend on the first path element for any command line. | 417 # By default scons will depend on the first path element for any command line. |
| 389 # For example, it will resolve 'gcc' with $PATH and depend on that for any | 418 # For example, it will resolve 'gcc' with $PATH and depend on that for any |
| 390 # action which runs gcc. This disables this behaviour: | 419 # action which runs gcc. This disables this behaviour: |
| 391 linux_env['IMPLICIT_COMMAND_DEPENDENCIES'] = False | 420 linux_env['IMPLICIT_COMMAND_DEPENDENCIES'] = False |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 FRAMEWORKS = [ | 646 FRAMEWORKS = [ |
| 618 'AppKit', | 647 'AppKit', |
| 619 'ApplicationServices', | 648 'ApplicationServices', |
| 620 'Foundation', | 649 'Foundation', |
| 621 ], | 650 ], |
| 622 | 651 |
| 623 ICU_LIBS = ['icui18n', 'icuuc', 'icudata'], | 652 ICU_LIBS = ['icui18n', 'icuuc', 'icudata'], |
| 624 ) | 653 ) |
| 625 | 654 |
| 626 | 655 |
| 656 # -------------------------------------------------------------------------- |
| 657 # Platform-independent "xcode" mode for generating XCode files |
| 658 # from any platform. |
| 659 |
| 660 DeclareBit('xcode', 'Generate XCode files') |
| 661 |
| 662 # TODO(sgk): remove this after we update Hammer modules. |
| 663 DeclareBit('mac', 'Target platform is mac.') |
| 664 |
| 665 xcode_env = mac_env.Clone() |
| 666 # TODO(sgk): uncomment when xcode generation becomes real. |
| 667 #environment_list.append(xcode_env) |
| 668 xcode_env.Replace( |
| 669 BUILD_TYPE = 'xcode', |
| 670 BUILD_TYPE_DESCRIPTION = 'Generate XCode files', |
| 671 HOST_PLATFORMS = ['*'], |
| 672 ICU_LIBS = [], |
| 673 ) |
| 674 xcode_env.SetBits('mac', 'xcode') |
| 675 # TODO(sgk): turn into separate debug + release env adding |
| 676 # to a common .sln file |
| 677 xcode_env.Tool('target_debug') |
| 678 |
| 679 |
| 627 # ------------------------------------------------------------------------- | 680 # ------------------------------------------------------------------------- |
| 628 | 681 |
| 629 | 682 |
| 630 # Overlay things from a layer below. | 683 # Overlay things from a layer below. |
| 631 for env in environment_list: | 684 for env in environment_list: |
| 632 env.Dir('$OBJ_ROOT').addRepository(env.Dir('$CHROME_SRC_DIR')) | 685 env.Dir('$OBJ_ROOT').addRepository(env.Dir('$CHROME_SRC_DIR')) |
| 633 env.Dir('$OBJ_ROOT/googleurl').addRepository(env.Dir('$CHROME_SRC_DIR/build')) | 686 env.Dir('$OBJ_ROOT/googleurl').addRepository(env.Dir('$CHROME_SRC_DIR/build')) |
| 634 | 687 |
| 635 # We pre-resolve some common targets. We end up spending lots of time | 688 # We pre-resolve some common targets. We end up spending lots of time |
| 636 # resolving these over and over again. | 689 # resolving these over and over again. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 664 tw = textwrap.TextWrapper( | 717 tw = textwrap.TextWrapper( |
| 665 width = 78, | 718 width = 78, |
| 666 initial_indent = ' '*32, | 719 initial_indent = ' '*32, |
| 667 subsequent_indent = ' '*32, | 720 subsequent_indent = ' '*32, |
| 668 ) | 721 ) |
| 669 components = tw.fill(', '.join(components)) | 722 components = tw.fill(', '.join(components)) |
| 670 all_system_libs = tw.fill(', '.join(env['all_system_libs'])) | 723 all_system_libs = tw.fill(', '.join(env['all_system_libs'])) |
| 671 | 724 |
| 672 Help(help_fmt % (components, all_system_libs)) | 725 Help(help_fmt % (components, all_system_libs)) |
| 673 | 726 |
| 674 | |
| 675 Import('build_component') | |
| 676 Default(None) # Reset default target to empty. | |
| 677 Default(Alias(build_component)) # Set default target based on where built. | |
| 678 | |
| 679 # ------------------------------------------------------------------------- | 727 # ------------------------------------------------------------------------- |
| 680 | 728 |
| 681 # Invoke all the SConscripts in each of the environments that make sense on | 729 # Invoke all the SConscripts in each of the environments that make sense on |
| 682 # this host-platform. | 730 # this host-platform. |
| 683 BuildComponents(environment_list) | 731 BuildComponents(environment_list) |
| 684 | 732 |
| 685 # ------------------------------------------------------------------------- | 733 # ------------------------------------------------------------------------- |
| 686 | 734 |
| 735 Default(None) # Reset default target to empty. |
| 736 |
| 737 modes = GetTargetModes().keys() |
| 738 |
| 739 if set(modes) - set(['msvs', 'xcode']): |
| 740 # There's at least one mode being built besides the platform- |
| 741 # independent 'msvs' or 'xcode' modes. Build the current |
| 742 # build_component's Alias as default--that is, "base" when we're |
| 743 # in the base/ subdirectory, "chrome" under chrome/, etc. |
| 744 Import('build_component') |
| 745 Default(Alias(build_component)) # Set default target based on where built. |
| 746 |
| 747 if 'msvs' in modes: |
| 748 # We're in --mode=msvs, so add its Alias(es) to the default targets. |
| 749 Default(Alias('solutions')) |
| 750 |
| 751 # ------------------------------------------------------------------------- |
| 752 |
| 687 # This must occur after BuildComponents so that the dependency graph | 753 # This must occur after BuildComponents so that the dependency graph |
| 688 # will be populated. | 754 # will be populated. |
| 689 vs_env = windows_env.Clone() | 755 vs_env = windows_env.Clone() |
| 690 vs_env.Append(COMPONENT_VS_SOURCE_SUFFIXES = [ | 756 vs_env.Append(COMPONENT_VS_SOURCE_SUFFIXES = [ |
| 691 '.def', | 757 '.def', |
| 692 '.ini', | 758 '.ini', |
| 693 '.txt', | 759 '.txt', |
| 694 '.ui', | 760 '.ui', |
| 695 '.xml', | 761 '.xml', |
| 696 ]) | 762 ]) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 'all_libraries', | 802 'all_libraries', |
| 737 'all_languages', | 803 'all_languages', |
| 738 'all_programs', | 804 'all_programs', |
| 739 'all_test_programs', | 805 'all_test_programs', |
| 740 ], projects = [p], | 806 ], projects = [p], |
| 741 COMPONENT_VS_PROJECT_SCRIPT_PATH=( | 807 COMPONENT_VS_PROJECT_SCRIPT_PATH=( |
| 742 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), | 808 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), |
| 743 ) | 809 ) |
| 744 | 810 |
| 745 # ------------------------------------------------------------------------- | 811 # ------------------------------------------------------------------------- |
| OLD | NEW |