| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """A tool to build chrome, executed by buildbot. | 6 """A tool to build chrome, executed by buildbot. |
| 7 | 7 |
| 8 When this is run, the current directory (cwd) should be the outer build | 8 When this is run, the current directory (cwd) should be the outer build |
| 9 directory (e.g., chrome-release/build/). | 9 directory (e.g., chrome-release/build/). |
| 10 | 10 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 goma_jobs = 100 | 234 goma_jobs = 100 |
| 235 if jobs < goma_jobs: | 235 if jobs < goma_jobs: |
| 236 jobs = goma_jobs | 236 jobs = goma_jobs |
| 237 command.append('-j%d' % jobs) | 237 command.append('-j%d' % jobs) |
| 238 return | 238 return |
| 239 | 239 |
| 240 if compiler == 'clang': | 240 if compiler == 'clang': |
| 241 clang_dir = os.path.abspath(os.path.join( | 241 clang_dir = os.path.abspath(os.path.join( |
| 242 slave_utils.SlaveBaseDir(options.build_dir), 'build', 'src', | 242 slave_utils.SlaveBaseDir(options.build_dir), 'build', 'src', |
| 243 'third_party', 'llvm-build', 'Release+Asserts', 'bin')) | 243 'third_party', 'llvm-build', 'Release+Asserts', 'bin')) |
| 244 env['CC'] = os.path.join(clang_dir, 'clang') | 244 env['CC.host'] = env['CC'] = os.path.join(clang_dir, 'clang') |
| 245 env['CXX'] = os.path.join(clang_dir, 'clang++') | 245 env['CXX.host'] = env['CXX'] = os.path.join(clang_dir, 'clang++') |
| 246 | 246 |
| 247 # We intentionally don't reuse the ccache/distcc modifications, | 247 # We intentionally don't reuse the ccache/distcc modifications, |
| 248 # as they don't work with clang. | 248 # as they don't work with clang. |
| 249 command.append('-j%d' % jobs) | 249 command.append('-j%d' % jobs) |
| 250 command.append('-r') | 250 command.append('-r') |
| 251 return | 251 return |
| 252 | 252 |
| 253 # Use gcc and g++ by default. | 253 # Use gcc and g++ by default. |
| 254 cc = 'gcc' | 254 cc = 'gcc' |
| 255 cpp = 'g++' | 255 cpp = 'g++' |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 main = build_tool_map.get(options.build_tool) | 697 main = build_tool_map.get(options.build_tool) |
| 698 if not main: | 698 if not main: |
| 699 sys.stderr.write('Unknown build tool %s.\n' % repr(options.build_tool)) | 699 sys.stderr.write('Unknown build tool %s.\n' % repr(options.build_tool)) |
| 700 return 2 | 700 return 2 |
| 701 | 701 |
| 702 return main(options, args) | 702 return main(options, args) |
| 703 | 703 |
| 704 | 704 |
| 705 if '__main__' == __name__: | 705 if '__main__' == __name__: |
| 706 sys.exit(real_main()) | 706 sys.exit(real_main()) |
| OLD | NEW |