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

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

Issue 159792: Make generators robust in the face of generator_flags being defined.... (Closed) Base URL: http://gyp.googlecode.com/svn/
Patch Set: Created 11 years, 4 months 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 | « trunk/pylib/gyp/generator/make.py ('k') | trunk/pylib/gyp/generator/xcode.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 3
4 import os 4 import os
5 import re 5 import re
6 import subprocess 6 import subprocess
7 import sys 7 import sys
8 import gyp.common 8 import gyp.common
9 import gyp.MSVSNew as MSVSNew 9 import gyp.MSVSNew as MSVSNew
10 import gyp.MSVSToolFile as MSVSToolFile 10 import gyp.MSVSToolFile as MSVSToolFile
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 dependencies=deps) 855 dependencies=deps)
856 # Store it to the list of objects. 856 # Store it to the list of objects.
857 project_objs[qualified_target] = obj 857 project_objs[qualified_target] = obj
858 # Return project object. 858 # Return project object.
859 return obj 859 return obj
860 860
861 861
862 def CalculateVariables(default_variables, params): 862 def CalculateVariables(default_variables, params):
863 """Generated variables that require params to be known.""" 863 """Generated variables that require params to be known."""
864 864
865 generator_flags = params['generator_flags'] 865 generator_flags = params.get('generator_flags', {})
866 866
867 # Select project file format version (if unset, default to auto detecting). 867 # Select project file format version (if unset, default to auto detecting).
868 msvs_version = \ 868 msvs_version = \
869 MSVSVersion.SelectVisualStudioVersion(generator_flags.get('msvs_version', 869 MSVSVersion.SelectVisualStudioVersion(generator_flags.get('msvs_version',
870 'auto')) 870 'auto'))
871 # Stash msvs_version for later (so we don't have to probe the system twice). 871 # Stash msvs_version for later (so we don't have to probe the system twice).
872 params['msvs_version'] = msvs_version 872 params['msvs_version'] = msvs_version
873 873
874 # Set a variable so conditions can be based on msvs_version. 874 # Set a variable so conditions can be based on msvs_version.
875 default_variables['MSVS_VERSION'] = msvs_version.ShortName() 875 default_variables['MSVS_VERSION'] = msvs_version.ShortName()
(...skipping 13 matching lines...) Expand all
889 """Generate .sln and .vcproj files. 889 """Generate .sln and .vcproj files.
890 890
891 This is the entry point for this generator. 891 This is the entry point for this generator.
892 Arguments: 892 Arguments:
893 target_list: List of target pairs: 'base/base.gyp:base'. 893 target_list: List of target pairs: 'base/base.gyp:base'.
894 target_dicts: Dict of target properties keyed on target pair. 894 target_dicts: Dict of target properties keyed on target pair.
895 data: Dictionary containing per .gyp data. 895 data: Dictionary containing per .gyp data.
896 """ 896 """
897 897
898 options = params['options'] 898 options = params['options']
899 generator_flags = params['generator_flags'] 899 generator_flags = params.get('generator_flags', {})
900 900
901 # Get the project file format version back out of where we stashed it in 901 # Get the project file format version back out of where we stashed it in
902 # GeneratorCalculatedVariables. 902 # GeneratorCalculatedVariables.
903 msvs_version = params['msvs_version'] 903 msvs_version = params['msvs_version']
904 904
905 # Prepare the set of configurations. 905 # Prepare the set of configurations.
906 configs = set() 906 configs = set()
907 for qualified_target in target_list: 907 for qualified_target in target_list:
908 build_file = gyp.common.BuildFileAndTarget('', qualified_target)[0] 908 build_file = gyp.common.BuildFileAndTarget('', qualified_target)[0]
909 spec = target_dicts[qualified_target] 909 spec = target_dicts[qualified_target]
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 _ProjectObject(sln_path, p, project_objs, projects) 944 _ProjectObject(sln_path, p, project_objs, projects)
945 # Create folder hierarchy. 945 # Create folder hierarchy.
946 root_entries = _GatherSolutionFolders(project_objs) 946 root_entries = _GatherSolutionFolders(project_objs)
947 # Create solution. 947 # Create solution.
948 sln = MSVSNew.MSVSSolution(sln_path, 948 sln = MSVSNew.MSVSSolution(sln_path,
949 entries=root_entries, 949 entries=root_entries,
950 variants=configs, 950 variants=configs,
951 websiteProperties=False, 951 websiteProperties=False,
952 version=msvs_version) 952 version=msvs_version)
953 sln.Write() 953 sln.Write()
OLDNEW
« no previous file with comments | « trunk/pylib/gyp/generator/make.py ('k') | trunk/pylib/gyp/generator/xcode.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698