OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. 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 This module helps emulate Visual Studio 2008 behavior on top of other | 6 This module helps emulate Visual Studio 2008 behavior on top of other |
7 build systems, primarily ninja. | 7 build systems, primarily ninja. |
8 """ | 8 """ |
9 | 9 |
10 import os | 10 import os |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 ld('EnableCOMDATFolding', map={'1': 'NOICF', '2': 'ICF'}, prefix='/OPT:') | 446 ld('EnableCOMDATFolding', map={'1': 'NOICF', '2': 'ICF'}, prefix='/OPT:') |
447 ld('LinkTimeCodeGeneration', map={'1': '/LTCG'}) | 447 ld('LinkTimeCodeGeneration', map={'1': '/LTCG'}) |
448 ld('IgnoreDefaultLibraryNames', prefix='/NODEFAULTLIB:') | 448 ld('IgnoreDefaultLibraryNames', prefix='/NODEFAULTLIB:') |
449 ld('ResourceOnlyDLL', map={'true': '/NOENTRY'}) | 449 ld('ResourceOnlyDLL', map={'true': '/NOENTRY'}) |
450 ld('EntryPointSymbol', prefix='/ENTRY:') | 450 ld('EntryPointSymbol', prefix='/ENTRY:') |
451 ld('Profile', map={'true': '/PROFILE'}) | 451 ld('Profile', map={'true': '/PROFILE'}) |
452 ld('LargeAddressAware', | 452 ld('LargeAddressAware', |
453 map={'1': ':NO', '2': ''}, prefix='/LARGEADDRESSAWARE') | 453 map={'1': ':NO', '2': ''}, prefix='/LARGEADDRESSAWARE') |
454 # TODO(scottmg): This should sort of be somewhere else (not really a flag). | 454 # TODO(scottmg): This should sort of be somewhere else (not really a flag). |
455 ld('AdditionalDependencies', prefix='') | 455 ld('AdditionalDependencies', prefix='') |
456 # TODO(scottmg): These too. | |
457 ldflags.extend(('kernel32.lib', 'user32.lib', 'gdi32.lib', 'winspool.lib', | |
458 'comdlg32.lib', 'advapi32.lib', 'shell32.lib', 'ole32.lib', | |
459 'oleaut32.lib', 'uuid.lib', 'odbc32.lib', 'DelayImp.lib')) | |
460 | 456 |
461 # If the base address is not specifically controlled, DYNAMICBASE should | 457 # If the base address is not specifically controlled, DYNAMICBASE should |
462 # be on by default. | 458 # be on by default. |
463 base_flags = filter(lambda x: 'DYNAMICBASE' in x or x == '/FIXED', | 459 base_flags = filter(lambda x: 'DYNAMICBASE' in x or x == '/FIXED', |
464 ldflags) | 460 ldflags) |
465 if not base_flags: | 461 if not base_flags: |
466 ldflags.append('/DYNAMICBASE') | 462 ldflags.append('/DYNAMICBASE') |
467 | 463 |
468 # If the NXCOMPAT flag has not been specified, default to on. Despite the | 464 # If the NXCOMPAT flag has not been specified, default to on. Despite the |
469 # documentation that says this only defaults to on when the subsystem is | 465 # documentation that says this only defaults to on when the subsystem is |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 so they're not surprised when the VS build fails.""" | 762 so they're not surprised when the VS build fails.""" |
767 if int(generator_flags.get('msvs_error_on_missing_sources', 0)): | 763 if int(generator_flags.get('msvs_error_on_missing_sources', 0)): |
768 no_specials = filter(lambda x: '$' not in x, sources) | 764 no_specials = filter(lambda x: '$' not in x, sources) |
769 relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] | 765 relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] |
770 missing = filter(lambda x: not os.path.exists(x), relative) | 766 missing = filter(lambda x: not os.path.exists(x), relative) |
771 if missing: | 767 if missing: |
772 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the | 768 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the |
773 # path for a slightly less crazy looking output. | 769 # path for a slightly less crazy looking output. |
774 cleaned_up = [os.path.normpath(x) for x in missing] | 770 cleaned_up = [os.path.normpath(x) for x in missing] |
775 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) | 771 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) |
OLD | NEW |