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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
395 ld('RandomizedBaseAddress', | 395 ld('RandomizedBaseAddress', |
396 map={'1': ':NO', '2': ''}, prefix='/DYNAMICBASE') | 396 map={'1': ':NO', '2': ''}, prefix='/DYNAMICBASE') |
397 ld('DataExecutionPrevention', | 397 ld('DataExecutionPrevention', |
398 map={'1': ':NO', '2': ''}, prefix='/NXCOMPAT') | 398 map={'1': ':NO', '2': ''}, prefix='/NXCOMPAT') |
399 ld('OptimizeReferences', map={'1': 'NOREF', '2': 'REF'}, prefix='/OPT:') | 399 ld('OptimizeReferences', map={'1': 'NOREF', '2': 'REF'}, prefix='/OPT:') |
400 ld('EnableCOMDATFolding', map={'1': 'NOICF', '2': 'ICF'}, prefix='/OPT:') | 400 ld('EnableCOMDATFolding', map={'1': 'NOICF', '2': 'ICF'}, prefix='/OPT:') |
401 ld('LinkTimeCodeGeneration', map={'1': '/LTCG'}) | 401 ld('LinkTimeCodeGeneration', map={'1': '/LTCG'}) |
402 ld('IgnoreDefaultLibraryNames', prefix='/NODEFAULTLIB:') | 402 ld('IgnoreDefaultLibraryNames', prefix='/NODEFAULTLIB:') |
403 ld('ResourceOnlyDLL', map={'true': '/NOENTRY'}) | 403 ld('ResourceOnlyDLL', map={'true': '/NOENTRY'}) |
404 ld('EntryPointSymbol', prefix='/ENTRY:') | 404 ld('EntryPointSymbol', prefix='/ENTRY:') |
405 ld('Profile', map={ 'false': '', '': '', 'true': '/PROFILE'}) | |
scottmg
2012/10/26 20:31:57
remove all but the 'true' case (other values with
noelallen1
2012/10/27 23:22:00
Done.
| |
405 # TODO(scottmg): This should sort of be somewhere else (not really a flag). | 406 # TODO(scottmg): This should sort of be somewhere else (not really a flag). |
406 ld('AdditionalDependencies', prefix='') | 407 ld('AdditionalDependencies', prefix='') |
407 # TODO(scottmg): These too. | 408 # TODO(scottmg): These too. |
408 ldflags.extend(('kernel32.lib', 'user32.lib', 'gdi32.lib', 'winspool.lib', | 409 ldflags.extend(('kernel32.lib', 'user32.lib', 'gdi32.lib', 'winspool.lib', |
409 'comdlg32.lib', 'advapi32.lib', 'shell32.lib', 'ole32.lib', | 410 'comdlg32.lib', 'advapi32.lib', 'shell32.lib', 'ole32.lib', |
410 'oleaut32.lib', 'uuid.lib', 'odbc32.lib', 'DelayImp.lib')) | 411 'oleaut32.lib', 'uuid.lib', 'odbc32.lib', 'DelayImp.lib')) |
411 | 412 |
412 # If the base address is not specifically controlled, DYNAMICBASE should | 413 # If the base address is not specifically controlled, DYNAMICBASE should |
413 # be on by default. | 414 # be on by default. |
414 base_flags = filter(lambda x: 'DYNAMICBASE' in x or x == '/FIXED', | 415 base_flags = filter(lambda x: 'DYNAMICBASE' in x or x == '/FIXED', |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
683 args = vs.SetupScript(arch) | 684 args = vs.SetupScript(arch) |
684 args.extend(('&&', 'set')) | 685 args.extend(('&&', 'set')) |
685 popen = subprocess.Popen( | 686 popen = subprocess.Popen( |
686 args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 687 args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
687 variables, _ = popen.communicate() | 688 variables, _ = popen.communicate() |
688 env = _ExtractImportantEnvironment(variables) | 689 env = _ExtractImportantEnvironment(variables) |
689 env_block = _FormatAsEnvironmentBlock(env) | 690 env_block = _FormatAsEnvironmentBlock(env) |
690 f = open_out(os.path.join(toplevel_build_dir, 'environment.' + arch), 'wb') | 691 f = open_out(os.path.join(toplevel_build_dir, 'environment.' + arch), 'wb') |
691 f.write(env_block) | 692 f.write(env_block) |
692 f.close() | 693 f.close() |
OLD | NEW |