| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 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 """Takes the same arguments as Windows link.exe, and a definition of libraries | 5 """Takes the same arguments as Windows link.exe, and a definition of libraries |
| 6 to split into subcomponents. Does multiple passes of link.exe invocation to | 6 to split into subcomponents. Does multiple passes of link.exe invocation to |
| 7 determine exports between parts and generates .def and import libraries to | 7 determine exports between parts and generates .def and import libraries to |
| 8 cause symbols to be available to other parts.""" | 8 cause symbols to be available to other parts.""" |
| 9 | 9 |
| 10 import _winreg | 10 import _winreg |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 data_exports = 0 | 371 data_exports = 0 |
| 372 for i, part in enumerate(unresolved_by_part): | 372 for i, part in enumerate(unresolved_by_part): |
| 373 for export in part: | 373 for export in part: |
| 374 if IsDataDefinition(export): | 374 if IsDataDefinition(export): |
| 375 print 'part %d contains data export: %s (aka %s)' % ( | 375 print 'part %d contains data export: %s (aka %s)' % ( |
| 376 i, Unmangle(export), export) | 376 i, Unmangle(export), export) |
| 377 data_exports += 1 | 377 data_exports += 1 |
| 378 deffiles = GenerateDefFiles(unresolved_by_part) | 378 deffiles = GenerateDefFiles(unresolved_by_part) |
| 379 import_libs = BuildImportLibs(flags, inputs_by_part, deffiles) | 379 import_libs = BuildImportLibs(flags, inputs_by_part, deffiles) |
| 380 else: | 380 else: |
| 381 return 1 | 381 if data_exports: |
| 382 | 382 print '%d data exports found, see report above.' % data_exports |
| 383 if data_exports: | 383 print('These cannot be exported, and must be either duplicated to the ' |
| 384 print 'Data exports found, see report above.' | 384 'target DLL (if constant), or wrapped in a function.') |
| 385 print('These cannot be exported, and must be either duplicated to the ' | |
| 386 'target DLL, or wrapped in a function.') | |
| 387 return 1 | 385 return 1 |
| 388 | 386 |
| 389 mt_exe = GetMtPath() | 387 mt_exe = GetMtPath() |
| 390 for i, dll in enumerate(dlls): | 388 for i, dll in enumerate(dlls): |
| 391 Log('embedding manifest in %s' % dll) | 389 Log('embedding manifest in %s' % dll) |
| 392 args = [mt_exe, '-nologo', '-manifest'] | 390 args = [mt_exe, '-nologo', '-manifest'] |
| 393 args.append(ManifestNameForIndex(i)) | 391 args.append(ManifestNameForIndex(i)) |
| 394 args.append(description['manifest']) | 392 args.append(description['manifest']) |
| 395 args.append('-outputresource:%s;2' % dll) | 393 args.append('-outputresource:%s;2' % dll) |
| 396 subprocess.check_call(args) | 394 subprocess.check_call(args) |
| 397 | 395 |
| 398 Log('built %r' % dlls) | 396 Log('built %r' % dlls) |
| 399 | 397 |
| 400 return 0 | 398 return 0 |
| 401 | 399 |
| 402 | 400 |
| 403 if __name__ == '__main__': | 401 if __name__ == '__main__': |
| 404 sys.exit(main()) | 402 sys.exit(main()) |
| OLD | NEW |