OLD | NEW |
1 #! -*- python -*- | 1 #! -*- python -*- |
2 # | 2 # |
3 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 3 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ Main scons script for Native Client SDK builds. | 7 """ Main scons script for Native Client SDK builds. |
8 | 8 |
9 Do not invoke this script directly, but instead use the scons or scons.bat | 9 Do not invoke this script directly, but instead use the scons or scons.bat |
10 wrapper function. E.g. | 10 wrapper function. E.g. |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 * cleaning: ./scons -c | 34 * cleaning: ./scons -c |
35 * build a target: ./scons <target> | 35 * build a target: ./scons <target> |
36 | 36 |
37 Supported targets: | 37 Supported targets: |
38 * bot Runs everything that the build and try bots run. | 38 * bot Runs everything that the build and try bots run. |
39 * debug_server_x64 Build the out-of-process debug_server. | 39 * debug_server_x64 Build the out-of-process debug_server. |
40 * debug_server_Win32 Build the out-of-process debug_server. | 40 * debug_server_Win32 Build the out-of-process debug_server. |
41 * docs Build all of the Doxygen documentation. | 41 * docs Build all of the Doxygen documentation. |
42 * examples Build the examples. | 42 * examples Build the examples. |
43 * experimental Build the experimental projects. | |
44 * installer Build the SDK installer. | 43 * installer Build the SDK installer. |
45 * nacl-bpad Build the native client crash reporting tool. | 44 * nacl-bpad Build the native client crash reporting tool. |
46 * sdk_tools Build nacl_sdk.zip and sdk_tools.tgz | 45 * sdk_tools Build nacl_sdk.zip and sdk_tools.tgz |
47 * toolchain Update the toolchain's headers and libraries. | 46 * toolchain Update the toolchain's headers and libraries. |
48 * vsx Build the Visual Studio Plugin. | 47 * vsx Build the Visual Studio Plugin. |
49 | 48 |
50 Flags: | 49 Flags: |
51 * USE_EXISTING_INSTALLER=1 Do not rebuild the installer if it exists. | 50 * USE_EXISTING_INSTALLER=1 Do not rebuild the installer if it exists. |
52 * chrome_browser_path=<full_path> Download Chrome to <full_path>. | 51 * chrome_browser_path=<full_path> Download Chrome to <full_path>. |
53 * SHOW_BROWSER=1 Don't suppress browser GUI while performing | 52 * SHOW_BROWSER=1 Don't suppress browser GUI while performing |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 base_env.SetDefault( | 113 base_env.SetDefault( |
115 PYTHON = ARGUMENTS.get('PYTHON', 'python'), | 114 PYTHON = ARGUMENTS.get('PYTHON', 'python'), |
116 USE_EXISTING_INSTALLER = ARGUMENTS.get('USE_EXISTING_INSTALLER', False), | 115 USE_EXISTING_INSTALLER = ARGUMENTS.get('USE_EXISTING_INSTALLER', False), |
117 SHOW_BROWSER = ARGUMENTS.get('SHOW_BROWSER', False), | 116 SHOW_BROWSER = ARGUMENTS.get('SHOW_BROWSER', False), |
118 ) | 117 ) |
119 | 118 |
120 base_env.Append( | 119 base_env.Append( |
121 BUILD_SCONSCRIPTS = [ | 120 BUILD_SCONSCRIPTS = [ |
122 # Keep in alphabetical order | 121 # Keep in alphabetical order |
123 'build_tools/build.scons', | 122 'build_tools/build.scons', |
124 'debugger/build.scons', | |
125 'documentation/build.scons', | 123 'documentation/build.scons', |
126 'experimental/visual_studio_plugin/build.scons', | |
127 'experimental/webgtt/tests/nacltest/test.scons', | |
128 'project_templates/test.scons', | 124 'project_templates/test.scons', |
129 ], | 125 ], |
130 ) | 126 ) |
131 | 127 |
132 base_env.Help(HELP_STRING) | 128 base_env.Help(HELP_STRING) |
133 | 129 |
134 KNOWN_SUITES = frozenset([ | 130 KNOWN_SUITES = frozenset([ |
135 'bot', | 131 'bot', |
136 ]) | 132 ]) |
137 | 133 |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 examples_builder) | 671 examples_builder) |
676 | 672 |
677 | 673 |
678 def DependsOnExamples(env, dependency): | 674 def DependsOnExamples(env, dependency): |
679 env.Depends(dependency, examples_builder) | 675 env.Depends(dependency, examples_builder) |
680 | 676 |
681 build_env.AddMethod(DependsOnExamples) | 677 build_env.AddMethod(DependsOnExamples) |
682 | 678 |
683 | 679 |
684 # ---------------------------------------------------------------------------- | 680 # ---------------------------------------------------------------------------- |
685 # Add a builder for experimental projects. This adds an Alias() node named | |
686 # 'experimental' that is always built. There is some special handling for the | |
687 # clean mode, since SCons relies on actual build products for its clean | |
688 # processing and will not run Alias() actions during clean unless they actually | |
689 # produce something. | |
690 | |
691 | |
692 def BuildExperimental(env, target, source): | |
693 '''Build the experimental projects. | |
694 | |
695 This runs the build command in the 'experimental' directory. | |
696 | |
697 Args: | |
698 env: The construction Environment() that is building the experimental | |
699 projects. | |
700 target: The target that triggered this build. Not used. | |
701 source: The sources used for this build. Not used. | |
702 ''' | |
703 subprocess.check_call(SconsBuildCommand(env), | |
704 cwd='experimental', | |
705 shell=True) | |
706 | |
707 | |
708 def CleanExperimental(env, target, source): | |
709 '''Clean the experimental projects. | |
710 | |
711 This runs the clean command in the 'experimental' directory. | |
712 | |
713 Args: | |
714 env: The construction Environment() that is building the experimental | |
715 projects. | |
716 ''' | |
717 subprocess.check_call('%s --clean' % SconsBuildCommand(env), | |
718 cwd='experimental', | |
719 shell=True) | |
720 | |
721 | |
722 experimental_builder = build_env.Alias('experimental', [toolchain_node], | |
723 BuildExperimental) | |
724 build_env.AlwaysBuild(experimental_builder) | |
725 build_env.AddCleanAction(['experimental'], CleanExperimental, ['bot'], | |
726 experimental_builder) | |
727 | |
728 # ---------------------------------------------------------------------------- | |
729 # Add helper functions that build/clean a test by invoking scons under the | 681 # Add helper functions that build/clean a test by invoking scons under the |
730 # test directory (|cwd|, when specified). These functions are meant to be | 682 # test directory (|cwd|, when specified). These functions are meant to be |
731 # called from corresponding project-specific 'Build<project>Test' and | 683 # called from corresponding project-specific 'Build<project>Test' and |
732 # 'Clean<project>Test' functions in the local test.scons scripts. Note that the | 684 # 'Clean<project>Test' functions in the local test.scons scripts. Note that the |
733 # CleanNaClTest does not require a |cwd| because its cwd is always '.' | 685 # CleanNaClTest does not require a |cwd| because its cwd is always '.' |
734 | 686 |
735 | 687 |
736 def BuildNaClTest(env, cwd): | 688 def BuildNaClTest(env, cwd): |
737 '''Build the test. | 689 '''Build the test. |
738 | 690 |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 | 1008 |
1057 build_env.AddMethod(TestVSSolution) | 1009 build_env.AddMethod(TestVSSolution) |
1058 | 1010 |
1059 | 1011 |
1060 # ---------------------------------------------------------------------------- | 1012 # ---------------------------------------------------------------------------- |
1061 BuildComponents(environment_list) | 1013 BuildComponents(environment_list) |
1062 | 1014 |
1063 # Require specifying an explicit target only when not cleaning | 1015 # Require specifying an explicit target only when not cleaning |
1064 if not GetOption('clean'): | 1016 if not GetOption('clean'): |
1065 Default(None) | 1017 Default(None) |
OLD | NEW |