| 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 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 variables, _ = popen.communicate() | 128 variables, _ = popen.communicate() |
| 129 env = _ExtractImportantEnvironment(variables) | 129 env = _ExtractImportantEnvironment(variables) |
| 130 env['PATH'] = runtime_dirs + ';' + env['PATH'] | 130 env['PATH'] = runtime_dirs + ';' + env['PATH'] |
| 131 | 131 |
| 132 if arch == cpu_arch: | 132 if arch == cpu_arch: |
| 133 for path in env['PATH'].split(os.pathsep): | 133 for path in env['PATH'].split(os.pathsep): |
| 134 if os.path.exists(os.path.join(path, 'cl.exe')): | 134 if os.path.exists(os.path.join(path, 'cl.exe')): |
| 135 vc_bin_dir = os.path.realpath(path) | 135 vc_bin_dir = os.path.realpath(path) |
| 136 break | 136 break |
| 137 | 137 |
| 138 # TODO(scottmg|thakis|dpranke): Is there an equivalent to | 138 # The Windows SDK include directories must be first. They both have a sal.h, |
| 139 # msvs_system_include_dirs that we need to inject into INCLUDE here? | 139 # and the SDK one is newer and the SDK uses some newer features from it not |
| 140 # present in the Visual Studio one. |
| 140 | 141 |
| 142 if win_sdk_path: |
| 143 additional_includes = ('{sdk_dir}\\Include\\shared;' + |
| 144 '{sdk_dir}\\Include\\um;' + |
| 145 '{sdk_dir}\\Include\\winrt;').format( |
| 146 sdk_dir=win_sdk_path) |
| 147 env['INCLUDE'] = additional_includes + env['INCLUDE'] |
| 141 env_block = _FormatAsEnvironmentBlock(env) | 148 env_block = _FormatAsEnvironmentBlock(env) |
| 142 with open('environment.' + arch, 'wb') as f: | 149 with open('environment.' + arch, 'wb') as f: |
| 143 f.write(env_block) | 150 f.write(env_block) |
| 144 | 151 |
| 145 assert vc_bin_dir | 152 assert vc_bin_dir |
| 146 print 'vc_bin_dir = "%s"' % vc_bin_dir | 153 print 'vc_bin_dir = "%s"' % vc_bin_dir |
| 147 | 154 |
| 148 | 155 |
| 149 if __name__ == '__main__': | 156 if __name__ == '__main__': |
| 150 main() | 157 main() |
| OLD | NEW |