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 19 matching lines...) Expand all Loading... |
30 tools = ['component_setup'], | 30 tools = ['component_setup'], |
31 | 31 |
32 # Requested list of system (shared) libraries, from the comma separated | 32 # Requested list of system (shared) libraries, from the comma separated |
33 # SYSTEM_LIBS command-line argument | 33 # SYSTEM_LIBS command-line argument |
34 req_system_libs = [], | 34 req_system_libs = [], |
35 # All supported system libraries, for the help message | 35 # All supported system libraries, for the help message |
36 all_system_libs = [], | 36 all_system_libs = [], |
37 | 37 |
38 CHROME_SRC_DIR = '$MAIN_DIR/..', | 38 CHROME_SRC_DIR = '$MAIN_DIR/..', |
39 DESTINATION_ROOT = '$MAIN_DIR/Hammer', | 39 DESTINATION_ROOT = '$MAIN_DIR/Hammer', |
40 TARGET_ROOT = '$DESTINATION_ROOT', | |
41 | 40 |
42 # Where ComponentTestProgram() will build test executables. | 41 # Where ComponentTestProgram() will build test executables. |
43 TESTS_DIR = '$TARGET_ROOT', | 42 TESTS_DIR = '$DESTINATION_ROOT', |
44 | 43 |
45 # Where ComponentProgram() will build program executables. | 44 # Where ComponentProgram() will build program executables. |
46 STAGING_DIR = '$TARGET_ROOT', | 45 STAGING_DIR = '$DESTINATION_ROOT', |
47 | 46 |
48 # Where ComponentLibrary() will build libraries. | 47 # Where ComponentLibrary() will build libraries. |
49 LIBS_DIR = '$COMPONENT_LIBRARY_DIR', | 48 LIBS_DIR = '$COMPONENT_LIBRARY_DIR', |
50 | 49 |
51 # TODO(hammer): when Hammer supports this... | 50 # TODO(hammer): when Hammer supports this... |
52 # Have Hammer prefix all Library aliases with lib_ (to avoid | 51 # Have Hammer prefix all Library aliases with lib_ (to avoid |
53 # collisions with the component names themselves). | 52 # collisions with the component names themselves). |
54 #COMPONENT_LIBRARY_ALIAS = 'lib_$LIBNAME', | 53 #COMPONENT_LIBRARY_ALIAS = 'lib_$LIBNAME', |
55 | 54 |
56 # Disable running of tests thru scons for now. | 55 # Disable running of tests thru scons for now. |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 windows_env['ENV']['SystemDrive'] = os.environ.get('SystemDrive', '') | 433 windows_env['ENV']['SystemDrive'] = os.environ.get('SystemDrive', '') |
435 windows_env['ENV']['USERPROFILE'] = os.environ.get('USERPROFILE', '') | 434 windows_env['ENV']['USERPROFILE'] = os.environ.get('USERPROFILE', '') |
436 | 435 |
437 windows_env.AppendENVPath('PATH', ';C:\\WINDOWS\\system32') | 436 windows_env.AppendENVPath('PATH', ';C:\\WINDOWS\\system32') |
438 | 437 |
439 | 438 |
440 # -------------------------------------------------------------------------- | 439 # -------------------------------------------------------------------------- |
441 # Linux specific | 440 # Linux specific |
442 | 441 |
443 linux_env = root_env.Clone() | 442 linux_env = root_env.Clone() |
444 environment_list.append(linux_env) | |
445 linux_env.Tool('target_platform_linux') | 443 linux_env.Tool('target_platform_linux') |
446 linux_env.Tool('target_debug') | |
447 linux_env.Tool('yacc') | 444 linux_env.Tool('yacc') |
448 linux_env.Replace( | |
449 BUILD_TYPE = 'debug-linux', | |
450 BUILD_TYPE_DESCRIPTION = 'Linux debug build', | |
451 ) | |
452 linux_env.Append(BUILD_GROUPS = ['default']) | |
453 | |
454 | 445 |
455 # TODO(bradnelson): this is needed for now because target_platform_linux has | 446 # TODO(bradnelson): this is needed for now because target_platform_linux has |
456 # OS_LINUX defined in a weird way. | 447 # OS_LINUX defined in a weird way. |
457 linux_env.FilterOut(CPPDEFINES = ['OS_LINUX=OS_LINUX']) | 448 linux_env.FilterOut(CPPDEFINES = ['OS_LINUX=OS_LINUX']) |
458 | 449 |
459 # Copy some environment variables from the outer environment to the | 450 # Copy some environment variables from the outer environment to the |
460 # SCons.Environment if they exist. | 451 # SCons.Environment if they exist. |
461 for envvar in ('CC', 'CXX'): | 452 for envvar in ('CC', 'CXX'): |
462 if envvar in os.environ: | 453 if envvar in os.environ: |
463 linux_env[envvar] = os.environ[envvar] | 454 linux_env[envvar] = os.environ[envvar] |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 'libxml requested in SYSTEM_LIBS but not found\n') | 550 'libxml requested in SYSTEM_LIBS but not found\n') |
560 sys.exit(1) | 551 sys.exit(1) |
561 if root_env.WantSystemLib('libxslt'): | 552 if root_env.WantSystemLib('libxslt'): |
562 try: | 553 try: |
563 linux_env.ParseConfig('pkg-config --cflags --libs libxslt') | 554 linux_env.ParseConfig('pkg-config --cflags --libs libxslt') |
564 except OSError, e: | 555 except OSError, e: |
565 print ('\n' | 556 print ('\n' |
566 'libxslt requested in SYSTEM_LIBS but not found\n') | 557 'libxslt requested in SYSTEM_LIBS but not found\n') |
567 sys.exit(1) | 558 sys.exit(1) |
568 | 559 |
| 560 linux_dbg = linux_env.Clone() |
| 561 environment_list.append(linux_dbg) |
| 562 linux_dbg.Replace( |
| 563 BUILD_TYPE = 'dbg', |
| 564 BUILD_TYPE_DESCRIPTION = 'Linux debug build', |
| 565 ) |
| 566 linux_dbg.Tool('target_debug') |
| 567 linux_dbg.Append(BUILD_GROUPS = ['default']) |
| 568 |
| 569 linux_opt = linux_env.Clone() |
| 570 environment_list.append(linux_opt) |
| 571 # Disable rpath for faster startup. |
| 572 linux_opt.Append(RPATH = []) |
| 573 linux_opt.Replace( |
| 574 BUILD_TYPE = 'opt', |
| 575 BUILD_TYPE_DESCRIPTION = 'Linux optimized build', |
| 576 ) |
| 577 linux_opt.Tool('target_optimized') |
| 578 |
569 # -------------------------------------------------------------------------- | 579 # -------------------------------------------------------------------------- |
570 # Mac specific | 580 # Mac specific |
571 | 581 |
572 mac_env = root_env.Clone() | 582 mac_env = root_env.Clone() |
573 environment_list.append(mac_env) | 583 environment_list.append(mac_env) |
574 mac_env.Tool('target_platform_mac') | 584 mac_env.Tool('target_platform_mac') |
575 mac_env.Tool('target_debug') | 585 mac_env.Tool('target_debug') |
576 mac_env.Replace( | 586 mac_env.Replace( |
577 BUILD_TYPE = 'debug-mac', | 587 BUILD_TYPE = 'debug-mac', |
578 BUILD_TYPE_DESCRIPTION = 'Mac debug build', | 588 BUILD_TYPE_DESCRIPTION = 'Mac debug build', |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 'all_libraries', | 781 'all_libraries', |
772 'all_languages', | 782 'all_languages', |
773 'all_programs', | 783 'all_programs', |
774 'all_test_programs', | 784 'all_test_programs', |
775 ], projects = [p], | 785 ], projects = [p], |
776 COMPONENT_VS_PROJECT_SCRIPT_PATH=( | 786 COMPONENT_VS_PROJECT_SCRIPT_PATH=( |
777 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), | 787 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), |
778 ) | 788 ) |
779 | 789 |
780 # ------------------------------------------------------------------------- | 790 # ------------------------------------------------------------------------- |
OLD | NEW |