Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 errno | 5 import errno |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 | 10 |
| 11 """ | 11 """ |
| 12 Copies the given "win tool" (which the toolchain uses to wrap compiler | 12 Copies the given "win tool" (which the toolchain uses to wrap compiler |
| 13 invocations) and the environment blocks for the 32-bit and 64-bit builds on | 13 invocations) and the environment blocks for the 32-bit and 64-bit builds on |
| 14 Windows to the build directory. | 14 Windows to the build directory. |
| 15 | 15 |
| 16 The arguments are the visual studio install location and the location of the | 16 The arguments are the visual studio install location and the location of the |
| 17 win tool. The script assumes that the root build directory is the current dir | 17 win tool. The script assumes that the root build directory is the current dir |
| 18 and the files will be written to the current directory. | 18 and the files will be written to the current directory. |
| 19 """ | 19 """ |
| 20 | 20 |
| 21 | 21 |
| 22 def ExtractImportantEnvironment(): | 22 def ExtractImportantEnvironment(): |
| 23 """Extracts environment variables required for the toolchain from the | 23 """Extracts environment variables required for the toolchain from the |
| 24 current environment.""" | 24 current environment.""" |
| 25 envvars_to_save = ( | 25 envvars_to_save = ( |
| 26 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. | 26 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. |
| 27 'include', # Needed by midl compiler. | |
|
scottmg
2014/06/17 20:32:40
ah, you found one!
| |
| 27 'path', | 28 'path', |
| 28 'pathext', | 29 'pathext', |
| 29 'systemroot', | 30 'systemroot', |
| 30 'temp', | 31 'temp', |
| 31 'tmp', | 32 'tmp', |
| 32 ) | 33 ) |
| 33 result = {} | 34 result = {} |
| 34 for envvar in envvars_to_save: | 35 for envvar in envvars_to_save: |
| 35 if envvar in os.environ: | 36 if envvar in os.environ: |
| 36 envvar = envvar.lower() | 37 envvar = envvar.lower() |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 env_file.write(environ) | 99 env_file.write(environ) |
| 99 | 100 |
| 100 # Add 64-bit compiler path to the beginning and write the block. | 101 # Add 64-bit compiler path to the beginning and write the block. |
| 101 path64 = [os.path.join(vs_path, "VC\\BIN\\amd64")] + \ | 102 path64 = [os.path.join(vs_path, "VC\\BIN\\amd64")] + \ |
| 102 [os.path.join(win_sdk_path, "bin\\x64")] + \ | 103 [os.path.join(win_sdk_path, "bin\\x64")] + \ |
| 103 path | 104 path |
| 104 important_env_vars["PATH"] = ";".join(path64) | 105 important_env_vars["PATH"] = ";".join(path64) |
| 105 environ = FormatAsEnvironmentBlock(important_env_vars) | 106 environ = FormatAsEnvironmentBlock(important_env_vars) |
| 106 with open('environment.x64', 'wb') as env_file: | 107 with open('environment.x64', 'wb') as env_file: |
| 107 env_file.write(environ) | 108 env_file.write(environ) |
| OLD | NEW |