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 # Copies the given "win tool" (which the toolchain uses to wrap compiler | 5 # Copies the given "win tool" (which the toolchain uses to wrap compiler |
6 # invocations) and the environment blocks for the 32-bit and 64-bit builds on | 6 # invocations) and the environment blocks for the 32-bit and 64-bit builds on |
7 # Windows to the build directory. | 7 # Windows to the build directory. |
8 # | 8 # |
9 # The arguments are the visual studio install location and the location of the | 9 # The arguments are the visual studio install location and the location of the |
10 # win tool. The script assumes that the root build directory is the current dir | 10 # win tool. The script assumes that the root build directory is the current dir |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 if cpu == target_cpu: | 147 if cpu == target_cpu: |
148 for path in env['PATH'].split(os.pathsep): | 148 for path in env['PATH'].split(os.pathsep): |
149 if os.path.exists(os.path.join(path, 'cl.exe')): | 149 if os.path.exists(os.path.join(path, 'cl.exe')): |
150 vc_bin_dir = os.path.realpath(path) | 150 vc_bin_dir = os.path.realpath(path) |
151 break | 151 break |
152 | 152 |
153 # The Windows SDK include directories must be first. They both have a sal.h, | 153 # The Windows SDK include directories must be first. They both have a sal.h, |
154 # and the SDK one is newer and the SDK uses some newer features from it not | 154 # and the SDK one is newer and the SDK uses some newer features from it not |
155 # present in the Visual Studio one. | 155 # present in the Visual Studio one. |
| 156 # I suspect this is not true in the brave-new world of VS 2015. However |
| 157 # when building with an installed version of VS 2013 there are additional |
| 158 # reasons to put these first - it's the only way to get the Windows 10 |
| 159 # SDK to be used. |
156 | 160 |
157 if win_sdk_path: | 161 if win_sdk_path: |
158 additional_includes = ('{sdk_dir}\\Include\\shared;' + | 162 # In package_from_installed.py this goes um;shared;winrt;ucrt |
159 '{sdk_dir}\\Include\\um;' + | 163 additional_includes = ('{sdk_dir}\\Include\\10.0.10586.0\\shared;' + |
160 '{sdk_dir}\\Include\\winrt;').format( | 164 '{sdk_dir}\\Include\\10.0.10586.0\\um;' + |
| 165 '{sdk_dir}\\Include\\10.0.10586.0\\winrt;').format( |
161 sdk_dir=win_sdk_path) | 166 sdk_dir=win_sdk_path) |
162 env['INCLUDE'] = additional_includes + env['INCLUDE'] | 167 env['INCLUDE'] = additional_includes + env['INCLUDE'] |
163 env_block = _FormatAsEnvironmentBlock(env) | 168 env_block = _FormatAsEnvironmentBlock(env) |
164 with open('environment.' + cpu, 'wb') as f: | 169 with open('environment.' + cpu, 'wb') as f: |
165 f.write(env_block) | 170 f.write(env_block) |
166 | 171 |
167 # Create a store app version of the environment. | 172 # Create a store app version of the environment. |
168 if 'LIB' in env: | 173 if 'LIB' in env: |
169 env['LIB'] = env['LIB'] .replace(r'\VC\LIB', r'\VC\LIB\STORE') | 174 env['LIB'] = env['LIB'] .replace(r'\VC\LIB', r'\VC\LIB\STORE') |
170 if 'LIBPATH' in env: | 175 if 'LIBPATH' in env: |
171 env['LIBPATH'] = env['LIBPATH'].replace(r'\VC\LIB', r'\VC\LIB\STORE') | 176 env['LIBPATH'] = env['LIBPATH'].replace(r'\VC\LIB', r'\VC\LIB\STORE') |
172 env_block = _FormatAsEnvironmentBlock(env) | 177 env_block = _FormatAsEnvironmentBlock(env) |
173 with open('environment.winrt_' + cpu, 'wb') as f: | 178 with open('environment.winrt_' + cpu, 'wb') as f: |
174 f.write(env_block) | 179 f.write(env_block) |
175 | 180 |
176 assert vc_bin_dir | 181 assert vc_bin_dir |
177 print 'vc_bin_dir = "%s"' % vc_bin_dir | 182 print 'vc_bin_dir = "%s"' % vc_bin_dir |
178 | 183 |
179 | 184 |
180 if __name__ == '__main__': | 185 if __name__ == '__main__': |
181 main() | 186 main() |
OLD | NEW |