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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 ld('LinkIncremental', map={'1': ':NO', '2': ''}, prefix='/INCREMENTAL') | 352 ld('LinkIncremental', map={'1': ':NO', '2': ''}, prefix='/INCREMENTAL') |
353 ld('FixedBaseAddress', map={'1': ':NO', '2': ''}, prefix='/FIXED') | 353 ld('FixedBaseAddress', map={'1': ':NO', '2': ''}, prefix='/FIXED') |
354 ld('RandomizedBaseAddress', | 354 ld('RandomizedBaseAddress', |
355 map={'1': ':NO', '2': ''}, prefix='/DYNAMICBASE') | 355 map={'1': ':NO', '2': ''}, prefix='/DYNAMICBASE') |
356 ld('DataExecutionPrevention', | 356 ld('DataExecutionPrevention', |
357 map={'1': ':NO', '2': ''}, prefix='/NXCOMPAT') | 357 map={'1': ':NO', '2': ''}, prefix='/NXCOMPAT') |
358 ld('OptimizeReferences', map={'1': 'NOREF', '2': 'REF'}, prefix='/OPT:') | 358 ld('OptimizeReferences', map={'1': 'NOREF', '2': 'REF'}, prefix='/OPT:') |
359 ld('EnableCOMDATFolding', map={'1': 'NOICF', '2': 'ICF'}, prefix='/OPT:') | 359 ld('EnableCOMDATFolding', map={'1': 'NOICF', '2': 'ICF'}, prefix='/OPT:') |
360 ld('LinkTimeCodeGeneration', map={'1': '/LTCG'}) | 360 ld('LinkTimeCodeGeneration', map={'1': '/LTCG'}) |
361 ld('IgnoreDefaultLibraryNames', prefix='/NODEFAULTLIB:') | 361 ld('IgnoreDefaultLibraryNames', prefix='/NODEFAULTLIB:') |
| 362 ld('ResourceOnlyDLL', map={'true': '/NOENTRY'}) |
362 # TODO(scottmg): This should sort of be somewhere else (not really a flag). | 363 # TODO(scottmg): This should sort of be somewhere else (not really a flag). |
363 ld('AdditionalDependencies', prefix='') | 364 ld('AdditionalDependencies', prefix='') |
364 # TODO(scottmg): These too. | 365 # TODO(scottmg): These too. |
365 ldflags.extend(('kernel32.lib', 'user32.lib', 'gdi32.lib', 'winspool.lib', | 366 ldflags.extend(('kernel32.lib', 'user32.lib', 'gdi32.lib', 'winspool.lib', |
366 'comdlg32.lib', 'advapi32.lib', 'shell32.lib', 'ole32.lib', | 367 'comdlg32.lib', 'advapi32.lib', 'shell32.lib', 'ole32.lib', |
367 'oleaut32.lib', 'uuid.lib', 'odbc32.lib', 'DelayImp.lib')) | 368 'oleaut32.lib', 'uuid.lib', 'odbc32.lib', 'DelayImp.lib')) |
368 | 369 |
369 # If the base address is not specifically controlled, DYNAMICBASE should | 370 # If the base address is not specifically controlled, DYNAMICBASE should |
370 # be on by default. | 371 # be on by default. |
371 base_flags = filter(lambda x: 'DYNAMICBASE' in x or x == '/FIXED', | 372 base_flags = filter(lambda x: 'DYNAMICBASE' in x or x == '/FIXED', |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 return vs.SetupScript() | 549 return vs.SetupScript() |
549 | 550 |
550 def ExpandMacros(string, expansions): | 551 def ExpandMacros(string, expansions): |
551 """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv | 552 """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv |
552 for the canonical way to retrieve a suitable dict.""" | 553 for the canonical way to retrieve a suitable dict.""" |
553 if '$' in string: | 554 if '$' in string: |
554 for old, new in expansions.iteritems(): | 555 for old, new in expansions.iteritems(): |
555 assert '$(' not in new, new | 556 assert '$(' not in new, new |
556 string = string.replace(old, new) | 557 string = string.replace(old, new) |
557 return string | 558 return string |
OLD | NEW |