| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """ | 5 """ |
| 6 From a system-installed copy of the toolchain, packages all the required bits | 6 From a system-installed copy of the toolchain, packages all the required bits |
| 7 into a .zip file. | 7 into a .zip file. |
| 8 | 8 |
| 9 It assumes default install locations for tools, in particular: | 9 It assumes default install locations for tools, in particular: |
| 10 - C:\Program Files (x86)\Microsoft Visual Studio 12.0\... | 10 - C:\Program Files (x86)\Microsoft Visual Studio 12.0\... |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 (r'C:\Program Files (x86)\Windows Kits\10\Include', 'Include'), | 118 (r'C:\Program Files (x86)\Windows Kits\10\Include', 'Include'), |
| 119 (r'C:\Program Files (x86)\Windows Kits\10\Lib', 'Lib'), | 119 (r'C:\Program Files (x86)\Windows Kits\10\Lib', 'Lib'), |
| 120 (r'C:\Program Files (x86)\Windows Kits\10\Source', 'Source')): | 120 (r'C:\Program Files (x86)\Windows Kits\10\Source', 'Source')): |
| 121 src, target = ucrt_path | 121 src, target = ucrt_path |
| 122 for root, _, files in os.walk(src): | 122 for root, _, files in os.walk(src): |
| 123 for f in files: | 123 for f in files: |
| 124 combined = os.path.normpath(os.path.join(root, f)) | 124 combined = os.path.normpath(os.path.join(root, f)) |
| 125 to = os.path.join('ucrt', target, combined[len(src) + 1:]) | 125 to = os.path.join('ucrt', target, combined[len(src) + 1:]) |
| 126 result.append((combined, to)) | 126 result.append((combined, to)) |
| 127 | 127 |
| 128 system_crt_files = [ |
| 129 'api-ms-win-core-file-l1-2-0.dll', |
| 130 'api-ms-win-core-file-l2-1-0.dll', |
| 131 'api-ms-win-core-localization-l1-2-0.dll', |
| 132 'api-ms-win-core-processthreads-l1-1-1.dll', |
| 133 'api-ms-win-core-synch-l1-2-0.dll', |
| 134 'api-ms-win-core-timezone-l1-1-0.dll', |
| 135 'api-ms-win-core-xstate-l2-1-0.dll', |
| 136 'api-ms-win-crt-conio-l1-1-0.dll', |
| 137 'api-ms-win-crt-convert-l1-1-0.dll', |
| 138 'api-ms-win-crt-environment-l1-1-0.dll', |
| 139 'api-ms-win-crt-filesystem-l1-1-0.dll', |
| 140 'api-ms-win-crt-heap-l1-1-0.dll', |
| 141 'api-ms-win-crt-locale-l1-1-0.dll', |
| 142 'api-ms-win-crt-math-l1-1-0.dll', |
| 143 'api-ms-win-crt-multibyte-l1-1-0.dll', |
| 144 'api-ms-win-crt-private-l1-1-0.dll', |
| 145 'api-ms-win-crt-process-l1-1-0.dll', |
| 146 'api-ms-win-crt-runtime-l1-1-0.dll', |
| 147 'api-ms-win-crt-stdio-l1-1-0.dll', |
| 148 'api-ms-win-crt-string-l1-1-0.dll', |
| 149 'api-ms-win-crt-time-l1-1-0.dll', |
| 150 'api-ms-win-crt-utility-l1-1-0.dll', |
| 151 'api-ms-win-eventing-provider-l1-1-0.dll', |
| 152 'ucrtbase.dll', |
| 153 'ucrtbased.dll', |
| 154 ] |
| 155 for system_crt_file in system_crt_files: |
| 156 result.append((os.path.join(r'C:\Windows\SysWOW64', system_crt_file), |
| 157 os.path.join('sys32', system_crt_file))) |
| 158 result.append((os.path.join(r'C:\Windows\System32', system_crt_file), |
| 159 os.path.join('sys64', system_crt_file))) |
| 160 |
| 128 # Generically drop all arm stuff that we don't need. | 161 # Generically drop all arm stuff that we don't need. |
| 129 return [(f, t) for f, t in result if 'arm\\' not in f.lower() and | 162 return [(f, t) for f, t in result if 'arm\\' not in f.lower() and |
| 130 'arm64\\' not in f.lower()] | 163 'arm64\\' not in f.lower()] |
| 131 | 164 |
| 132 | 165 |
| 133 def GenerateSetEnvCmd(target_dir): | 166 def GenerateSetEnvCmd(target_dir): |
| 134 """Generate a batch file that gyp expects to exist to set up the compiler | 167 """Generate a batch file that gyp expects to exist to set up the compiler |
| 135 environment. | 168 environment. |
| 136 | 169 |
| 137 This is normally generated by a full install of the SDK, but we | 170 This is normally generated by a full install of the SDK, but we |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 sys.stdout.write('\rWrote to %s.%s\n' % (output, ' '*50)) | 270 sys.stdout.write('\rWrote to %s.%s\n' % (output, ' '*50)) |
| 238 sys.stdout.flush() | 271 sys.stdout.flush() |
| 239 | 272 |
| 240 RenameToSha1(output) | 273 RenameToSha1(output) |
| 241 | 274 |
| 242 return 0 | 275 return 0 |
| 243 | 276 |
| 244 | 277 |
| 245 if __name__ == '__main__': | 278 if __name__ == '__main__': |
| 246 sys.exit(main()) | 279 sys.exit(main()) |
| OLD | NEW |