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

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

Issue 565743004: android: Add a way to override build system variables. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Change key to aosp_build_settings Created 6 years, 3 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 | test/android/gyptest-settings.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 # 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 # Notes: 5 # Notes:
6 # 6 #
7 # This generates makefiles suitable for inclusion into the Android build system 7 # This generates makefiles suitable for inclusion into the Android build system
8 # via an Android.mk file. It is based on make.py, the standard makefile 8 # via an Android.mk file. It is based on make.py, the standard makefile
9 # generator. 9 # generator.
10 # 10 #
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 # Make supports multiple toolsets 45 # Make supports multiple toolsets
46 generator_supports_multiple_toolsets = True 46 generator_supports_multiple_toolsets = True
47 47
48 48
49 # Generator-specific gyp specs. 49 # Generator-specific gyp specs.
50 generator_additional_non_configuration_keys = [ 50 generator_additional_non_configuration_keys = [
51 # Boolean to declare that this target does not want its name mangled. 51 # Boolean to declare that this target does not want its name mangled.
52 'android_unmangled_name', 52 'android_unmangled_name',
53 # Map of android build system variables to set.
54 'aosp_build_settings',
53 ] 55 ]
54 generator_additional_path_sections = [] 56 generator_additional_path_sections = []
55 generator_extra_sources_for_rules = [] 57 generator_extra_sources_for_rules = []
56 58
57 59
58 ALL_MODULES_FOOTER = """\ 60 ALL_MODULES_FOOTER = """\
59 # "gyp_all_modules" is a concatenation of the "gyp_all_modules" targets from 61 # "gyp_all_modules" is a concatenation of the "gyp_all_modules" targets from
60 # all the included sub-makefiles. This is just here to clarify. 62 # all the included sub-makefiles. This is just here to clarify.
61 gyp_all_modules: 63 gyp_all_modules:
62 """ 64 """
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 deps, link_deps: dependency lists; see ComputeDeps() 824 deps, link_deps: dependency lists; see ComputeDeps()
823 part_of_all: flag indicating this target is part of 'all' 825 part_of_all: flag indicating this target is part of 'all'
824 write_alias_target: flag indicating whether to create short aliases for this 826 write_alias_target: flag indicating whether to create short aliases for this
825 target 827 target
826 """ 828 """
827 self.WriteLn('### Rules for final target.') 829 self.WriteLn('### Rules for final target.')
828 830
829 if self.type != 'none': 831 if self.type != 'none':
830 self.WriteTargetFlags(spec, configs, link_deps) 832 self.WriteTargetFlags(spec, configs, link_deps)
831 833
834 settings = spec.get('aosp_build_settings', {})
835 if settings:
836 self.WriteLn('### Set directly by aosp_build_settings.')
837 for k, v in settings.iteritems():
838 if isinstance(v, list):
839 self.WriteList(v, k)
840 else:
841 self.WriteLn('%s := %s' % (k, make.QuoteIfNecessary(v)))
842 self.WriteLn('')
843
832 # Add to the set of targets which represent the gyp 'all' target. We use the 844 # Add to the set of targets which represent the gyp 'all' target. We use the
833 # name 'gyp_all_modules' as the Android build system doesn't allow the use 845 # name 'gyp_all_modules' as the Android build system doesn't allow the use
834 # of the Make target 'all' and because 'all_modules' is the equivalent of 846 # of the Make target 'all' and because 'all_modules' is the equivalent of
835 # the Make target 'all' on Android. 847 # the Make target 'all' on Android.
836 if part_of_all and write_alias_target: 848 if part_of_all and write_alias_target:
837 self.WriteLn('# Add target alias to "gyp_all_modules" target.') 849 self.WriteLn('# Add target alias to "gyp_all_modules" target.')
838 self.WriteLn('.PHONY: gyp_all_modules') 850 self.WriteLn('.PHONY: gyp_all_modules')
839 self.WriteLn('gyp_all_modules: %s' % self.android_module) 851 self.WriteLn('gyp_all_modules: %s' % self.android_module)
840 self.WriteLn('') 852 self.WriteLn('')
841 853
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 # Write out the sorted list of includes. 1081 # Write out the sorted list of includes.
1070 root_makefile.write('\n') 1082 root_makefile.write('\n')
1071 for include_file in sorted(include_list): 1083 for include_file in sorted(include_list):
1072 root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n') 1084 root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n')
1073 root_makefile.write('\n') 1085 root_makefile.write('\n')
1074 1086
1075 if write_alias_targets: 1087 if write_alias_targets:
1076 root_makefile.write(ALL_MODULES_FOOTER) 1088 root_makefile.write(ALL_MODULES_FOOTER)
1077 1089
1078 root_makefile.close() 1090 root_makefile.close()
OLDNEW
« no previous file with comments | « no previous file | test/android/gyptest-settings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698