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

Side by Side Diff: platform_tools/android/bin/gyp_to_android.py

Issue 183953002: Updates to the Android.mk writer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright 2014 Google Inc. 3 # Copyright 2014 Google Inc.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 7
8 """ 8 """
9 Script for generating the Android framework's version of Skia from gyp 9 Script for generating the Android framework's version of Skia from gyp
10 files. 10 files.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 # into a single Android.mk file, which can build targets of any 94 # into a single Android.mk file, which can build targets of any
95 # architecture type. 95 # architecture type.
96 96
97 # The default uses a non-existant archtype, to find all the general 97 # The default uses a non-existant archtype, to find all the general
98 # variable definitions. 98 # variable definitions.
99 default_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'other', 99 default_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'other',
100 False) 100 False)
101 arm_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm', False) 101 arm_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm', False)
102 arm_neon_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm', 102 arm_neon_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm',
103 True) 103 True)
104 if variables.INCLUDE_X86_OPTS: 104 x86_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'x86', False)
105 x86_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'x86', False) 105
106 else: 106 mips_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'mips', False)
107 x86_var_dict = None
108 107
109 # Compute the intersection of all targets. All the files in the intersection 108 # Compute the intersection of all targets. All the files in the intersection
110 # should be part of the makefile always. Each dict will now contain trimmed 109 # should be part of the makefile always. Each dict will now contain trimmed
111 # lists containing only variable definitions specific to that configuration. 110 # lists containing only variable definitions specific to that configuration.
112 var_dict_list = [default_var_dict, arm_var_dict, arm_neon_var_dict] 111 var_dict_list = [default_var_dict, arm_var_dict, arm_neon_var_dict,
113 if variables.INCLUDE_X86_OPTS: 112 x86_var_dict, mips_var_dict]
114 var_dict_list.append(x86_var_dict)
115 common = vars_dict_lib.intersect(var_dict_list) 113 common = vars_dict_lib.intersect(var_dict_list)
116 114
117 # Further trim arm_neon_var_dict with arm_var_dict. After this call, 115 # Further trim arm_neon_var_dict with arm_var_dict. After this call,
118 # arm_var_dict (which will now be the intersection) includes all definitions 116 # arm_var_dict (which will now be the intersection) includes all definitions
119 # used by both arm and arm + neon, and arm_neon_var_dict will only contain 117 # used by both arm and arm + neon, and arm_neon_var_dict will only contain
120 # those specific to arm + neon. 118 # those specific to arm + neon.
121 arm_var_dict = vars_dict_lib.intersect([arm_var_dict, arm_neon_var_dict]) 119 arm_var_dict = vars_dict_lib.intersect([arm_var_dict, arm_neon_var_dict])
122 120
121 # Now create a list of VarsDictData holding everything but common.
122 li = list()
123 li.append(makefile_writer.VarsDictData(arm_var_dict, 'arm'))
124 li.append(makefile_writer.VarsDictData(arm_neon_var_dict, 'arm',
125 'ARCH_ARM_HAVE_NEON'))
126 li.append(makefile_writer.VarsDictData(x86_var_dict, 'x86'))
127 # Currently, x86_64 is identical to x86
128 li.append(makefile_writer.VarsDictData(x86_var_dict, 'x86_64'))
129
130 li.append(makefile_writer.VarsDictData(mips_var_dict, 'mips'))
131
123 makefile_writer.write_android_mk(target_dir=target_dir, 132 makefile_writer.write_android_mk(target_dir=target_dir,
124 common=common, 133 common=common,
125 arm=arm_var_dict, 134 the_rest=li)
126 arm_neon=arm_neon_var_dict,
127 x86=x86_var_dict,
128 default=default_var_dict)
129 135
130 finally: 136 finally:
131 shutil.rmtree(tmp_folder) 137 shutil.rmtree(tmp_folder)
132 138
133 if __name__ == '__main__': 139 if __name__ == '__main__':
134 main() 140 main()
OLDNEW
« no previous file with comments | « no previous file | platform_tools/android/gyp_gen/makefile_writer.py » ('j') | platform_tools/android/gyp_gen/makefile_writer.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698