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

Side by Side Diff: trunk/pylib/gyp/generator/make.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 | « no previous file | trunk/pylib/gyp/generator/msvs.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 # Notes: 3 # Notes:
4 # 4 #
5 # This is all roughly based on the Makefile system used by the Linux 5 # This is all roughly based on the Makefile system used by the Linux
6 # kernel, but is a non-recursive make -- we put the entire dependency 6 # kernel, but is a non-recursive make -- we put the entire dependency
7 # graph in front of make and let it figure it out. 7 # graph in front of make and let it figure it out.
8 # 8 #
9 # The code below generates a separate .mk file for each target, but 9 # The code below generates a separate .mk file for each target, but
10 # all are sourced by the top-level Makefile. This means that all 10 # all are sourced by the top-level Makefile. This means that all
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 723
724 724
725 def FixupArgPath(self, arg): 725 def FixupArgPath(self, arg):
726 if '/' in arg or '.h.' in arg: 726 if '/' in arg or '.h.' in arg:
727 return self.Absolutify(arg) 727 return self.Absolutify(arg)
728 return arg 728 return arg
729 729
730 730
731 def GenerateOutput(target_list, target_dicts, data, params): 731 def GenerateOutput(target_list, target_dicts, data, params):
732 options = params['options'] 732 options = params['options']
733 generator_flags = params['generator_flags'] 733 generator_flags = params.get('generator_flags', {})
734 builddir_name = generator_flags.get('output_dir', 'out') 734 builddir_name = generator_flags.get('output_dir', 'out')
735 735
736 # TODO: search for the first non-'Default' target. This can go 736 # TODO: search for the first non-'Default' target. This can go
737 # away when we add verification that all targets have the 737 # away when we add verification that all targets have the
738 # necessary configurations. 738 # necessary configurations.
739 default_configuration = None 739 default_configuration = None
740 for target in target_list: 740 for target in target_list:
741 spec = target_dicts[target] 741 spec = target_dicts[target]
742 if spec['default_configuration'] != 'Default': 742 if spec['default_configuration'] != 'Default':
743 default_configuration = spec['default_configuration'] 743 default_configuration = spec['default_configuration']
(...skipping 20 matching lines...) Expand all
764 writer.Write(qualified_target, output_file, options.depth, spec, configs) 764 writer.Write(qualified_target, output_file, options.depth, spec, configs)
765 765
766 # Our root_makefile lives at the source root. Compute the relative path 766 # Our root_makefile lives at the source root. Compute the relative path
767 # from there to the output_file for including. 767 # from there to the output_file for including.
768 submakefile_path = gyp.common.RelativePath(output_file, options.depth) 768 submakefile_path = gyp.common.RelativePath(output_file, options.depth)
769 root_makefile.write('include ' + submakefile_path + "\n") 769 root_makefile.write('include ' + submakefile_path + "\n")
770 770
771 root_makefile.write(SHARED_FOOTER) 771 root_makefile.write(SHARED_FOOTER)
772 772
773 root_makefile.close() 773 root_makefile.close()
OLDNEW
« no previous file with comments | « no previous file | trunk/pylib/gyp/generator/msvs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698