| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client 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 import optparse | 6 import optparse |
| 7 import os.path | 7 import os.path |
| 8 import shutil | 8 import shutil |
| 9 import subprocess | 9 import subprocess |
| 10 import stat | 10 import stat |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 context['use_breakpad_tools'] = False | 72 context['use_breakpad_tools'] = False |
| 73 context['max_jobs'] = 8 | 73 context['max_jobs'] = 8 |
| 74 context['scons_args'] = [] | 74 context['scons_args'] = [] |
| 75 | 75 |
| 76 | 76 |
| 77 # Windows-specific environment manipulation | 77 # Windows-specific environment manipulation |
| 78 def SetupWindowsEnvironment(context): | 78 def SetupWindowsEnvironment(context): |
| 79 # Poke around looking for MSVC. We should do something more principled in | 79 # Poke around looking for MSVC. We should do something more principled in |
| 80 # the future. | 80 # the future. |
| 81 | 81 |
| 82 # NOTE! This affects only SCons. The GN build figures out MSVC on its own |
| 83 # and will wind up with a different version than this one (the same version |
| 84 # being used for Chromium builds). |
| 85 |
| 82 # The name of Program Files can differ, depending on the bittage of Windows. | 86 # The name of Program Files can differ, depending on the bittage of Windows. |
| 83 program_files = r'c:\Program Files (x86)' | 87 program_files = r'c:\Program Files (x86)' |
| 84 if not os.path.exists(program_files): | 88 if not os.path.exists(program_files): |
| 85 program_files = r'c:\Program Files' | 89 program_files = r'c:\Program Files' |
| 86 if not os.path.exists(program_files): | 90 if not os.path.exists(program_files): |
| 87 raise Exception('Cannot find the Program Files directory!') | 91 raise Exception('Cannot find the Program Files directory!') |
| 88 | 92 |
| 89 # The location of MSVC can differ depending on the version. | 93 # The location of MSVC can differ depending on the version. |
| 90 msvc_locs = [ | 94 msvc_locs = [ |
| 91 ('Microsoft Visual Studio 12.0', 'VS120COMNTOOLS', '2013'), | 95 ('Microsoft Visual Studio 12.0', 'VS120COMNTOOLS', '2013'), |
| 92 ('Microsoft Visual Studio 10.0', 'VS100COMNTOOLS', '2010'), | 96 ('Microsoft Visual Studio 10.0', 'VS100COMNTOOLS', '2010'), |
| 93 ('Microsoft Visual Studio 9.0', 'VS90COMNTOOLS', '2008'), | 97 ('Microsoft Visual Studio 9.0', 'VS90COMNTOOLS', '2008'), |
| 94 ('Microsoft Visual Studio 8.0', 'VS80COMNTOOLS', '2005'), | 98 ('Microsoft Visual Studio 8.0', 'VS80COMNTOOLS', '2005'), |
| 95 ] | 99 ] |
| 96 | 100 |
| 97 for dirname, comntools_var, gyp_msvs_version in msvc_locs: | 101 for dirname, comntools_var, gyp_msvs_version in msvc_locs: |
| 98 msvc = os.path.join(program_files, dirname) | 102 msvc = os.path.join(program_files, dirname) |
| 99 context.SetEnv('GYP_MSVS_VERSION', gyp_msvs_version) | |
| 100 if os.path.exists(msvc): | 103 if os.path.exists(msvc): |
| 101 break | 104 break |
| 102 else: | 105 else: |
| 103 # The break statement did not execute. | 106 # The break statement did not execute. |
| 104 raise Exception('Cannot find MSVC!') | 107 raise Exception('Cannot find MSVC!') |
| 105 | 108 |
| 106 # Put MSVC in the path. | 109 # Put MSVC in the path. |
| 107 vc = os.path.join(msvc, 'VC') | 110 vc = os.path.join(msvc, 'VC') |
| 108 comntools = os.path.join(msvc, 'Common7', 'Tools') | 111 comntools = os.path.join(msvc, 'Common7', 'Tools') |
| 109 perf = os.path.join(msvc, 'Team Tools', 'Performance Tools') | 112 perf = os.path.join(msvc, 'Team Tools', 'Performance Tools') |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 # Otherwise these go back to the preamble. | 653 # Otherwise these go back to the preamble. |
| 651 with Step('summary', status): | 654 with Step('summary', status): |
| 652 if status.ever_failed: | 655 if status.ever_failed: |
| 653 print 'There were failed stages.' | 656 print 'There were failed stages.' |
| 654 else: | 657 else: |
| 655 print 'Success.' | 658 print 'Success.' |
| 656 # Display a summary of the build. | 659 # Display a summary of the build. |
| 657 status.DisplayBuildStatus() | 660 status.DisplayBuildStatus() |
| 658 | 661 |
| 659 sys.exit(status.ReturnValue()) | 662 sys.exit(status.ReturnValue()) |
| OLD | NEW |