Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Side by Side Diff: pylib/gyp/generator/msvs.py

Issue 11361103: msvs: set $(TargetExt) when the "product_extension" is set Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import copy 5 import copy
6 import ntpath 6 import ntpath
7 import os 7 import os
8 import posixpath 8 import posixpath
9 import re 9 import re
10 import subprocess 10 import subprocess
(...skipping 2594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2605 intermediate = _FixPath('$(Configuration)') + '\\' 2605 intermediate = _FixPath('$(Configuration)') + '\\'
2606 msbuild_attributes['IntermediateDirectory'] = intermediate 2606 msbuild_attributes['IntermediateDirectory'] = intermediate
2607 if 'CharacterSet' in msbuild_attributes: 2607 if 'CharacterSet' in msbuild_attributes:
2608 msbuild_attributes['CharacterSet'] = _ConvertMSVSCharacterSet( 2608 msbuild_attributes['CharacterSet'] = _ConvertMSVSCharacterSet(
2609 msbuild_attributes['CharacterSet']) 2609 msbuild_attributes['CharacterSet'])
2610 if 'TargetName' not in msbuild_attributes: 2610 if 'TargetName' not in msbuild_attributes:
2611 prefix = spec.get('product_prefix', '') 2611 prefix = spec.get('product_prefix', '')
2612 product_name = spec.get('product_name', '$(ProjectName)') 2612 product_name = spec.get('product_name', '$(ProjectName)')
2613 target_name = prefix + product_name 2613 target_name = prefix + product_name
2614 msbuild_attributes['TargetName'] = target_name 2614 msbuild_attributes['TargetName'] = target_name
2615 if 'TargetExt' not in msbuild_attributes and 'product_extension' in spec:
2616 ext = spec.get('product_extension')
2617 msbuild_attributes['TargetExt'] = '.' + ext
2615 2618
2616 # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile' 2619 # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile'
2617 # (depending on the tool used) to avoid MSB8012 warning. 2620 # (depending on the tool used) to avoid MSB8012 warning.
2618 msbuild_tool_map = { 2621 msbuild_tool_map = {
2619 'executable': 'Link', 2622 'executable': 'Link',
2620 'shared_library': 'Link', 2623 'shared_library': 'Link',
2621 'loadable_module': 'Link', 2624 'loadable_module': 'Link',
2622 'static_library': 'Lib', 2625 'static_library': 'Lib',
2623 } 2626 }
2624 msbuild_tool = msbuild_tool_map.get(spec['type']) 2627 msbuild_tool = msbuild_tool_map.get(spec['type'])
(...skipping 26 matching lines...) Expand all
2651 for (name, configuration) in sorted(configurations.iteritems()): 2654 for (name, configuration) in sorted(configurations.iteritems()):
2652 condition = _GetConfigurationCondition(name, configuration) 2655 condition = _GetConfigurationCondition(name, configuration)
2653 attributes = _GetMSBuildAttributes(spec, configuration, build_file) 2656 attributes = _GetMSBuildAttributes(spec, configuration, build_file)
2654 msbuild_settings = configuration['finalized_msbuild_settings'] 2657 msbuild_settings = configuration['finalized_msbuild_settings']
2655 _AddConditionalProperty(properties, condition, 'IntDir', 2658 _AddConditionalProperty(properties, condition, 'IntDir',
2656 attributes['IntermediateDirectory']) 2659 attributes['IntermediateDirectory'])
2657 _AddConditionalProperty(properties, condition, 'OutDir', 2660 _AddConditionalProperty(properties, condition, 'OutDir',
2658 attributes['OutputDirectory']) 2661 attributes['OutputDirectory'])
2659 _AddConditionalProperty(properties, condition, 'TargetName', 2662 _AddConditionalProperty(properties, condition, 'TargetName',
2660 attributes['TargetName']) 2663 attributes['TargetName'])
2664 if 'TargetExt' in attributes:
2665 _AddConditionalProperty(properties, condition, 'TargetExt',
2666 attributes['TargetExt'])
2661 2667
2662 if attributes.get('TargetPath'): 2668 if attributes.get('TargetPath'):
2663 _AddConditionalProperty(properties, condition, 'TargetPath', 2669 _AddConditionalProperty(properties, condition, 'TargetPath',
2664 attributes['TargetPath']) 2670 attributes['TargetPath'])
2665 2671
2666 if new_paths: 2672 if new_paths:
2667 _AddConditionalProperty(properties, condition, 'ExecutablePath', 2673 _AddConditionalProperty(properties, condition, 'ExecutablePath',
2668 new_paths) 2674 new_paths)
2669 tool_settings = msbuild_settings.get('', {}) 2675 tool_settings = msbuild_settings.get('', {})
2670 for name, value in sorted(tool_settings.iteritems()): 2676 for name, value in sorted(tool_settings.iteritems()):
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
3160 action_spec.extend( 3166 action_spec.extend(
3161 # TODO(jeanluc) 'Document' for all or just if as_sources? 3167 # TODO(jeanluc) 'Document' for all or just if as_sources?
3162 [['FileType', 'Document'], 3168 [['FileType', 'Document'],
3163 ['Command', command], 3169 ['Command', command],
3164 ['Message', description], 3170 ['Message', description],
3165 ['Outputs', outputs] 3171 ['Outputs', outputs]
3166 ]) 3172 ])
3167 if additional_inputs: 3173 if additional_inputs:
3168 action_spec.append(['AdditionalInputs', additional_inputs]) 3174 action_spec.append(['AdditionalInputs', additional_inputs])
3169 actions_spec.append(action_spec) 3175 actions_spec.append(action_spec)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698