OLD | NEW |
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 # The default uses a non-existant archtype, to find all the general | 100 # The default uses a non-existant archtype, to find all the general |
101 # variable definitions. | 101 # variable definitions. |
102 default_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'other', | 102 default_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'other', |
103 False, gyp_source_dir) | 103 False, gyp_source_dir) |
104 arm_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm', False, | 104 arm_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm', False, |
105 gyp_source_dir) | 105 gyp_source_dir) |
106 arm_neon_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm', | 106 arm_neon_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm', |
107 True, gyp_source_dir) | 107 True, gyp_source_dir) |
108 x86_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'x86', False, | 108 x86_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'x86', False, |
109 gyp_source_dir) | 109 gyp_source_dir) |
| 110 x86_64_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'x86_64', |
| 111 False, gyp_source_dir) |
110 | 112 |
111 mips_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'mips', False, | 113 mips_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'mips', False, |
112 gyp_source_dir) | 114 gyp_source_dir) |
113 | 115 |
114 mips64_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'mips64', | 116 mips64_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'mips64', |
115 False, gyp_source_dir) | 117 False, gyp_source_dir) |
116 | 118 |
117 arm64_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm64', | 119 arm64_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm64', |
118 False, gyp_source_dir) | 120 False, gyp_source_dir) |
119 | 121 |
120 # Compute the intersection of all targets. All the files in the intersection | 122 # Compute the intersection of all targets. All the files in the intersection |
121 # should be part of the makefile always. Each dict will now contain trimmed | 123 # should be part of the makefile always. Each dict will now contain trimmed |
122 # lists containing only variable definitions specific to that configuration. | 124 # lists containing only variable definitions specific to that configuration. |
123 var_dict_list = [default_var_dict, arm_var_dict, arm_neon_var_dict, | 125 var_dict_list = [default_var_dict, arm_var_dict, arm_neon_var_dict, |
124 x86_var_dict, mips_var_dict, mips64_var_dict, | 126 x86_var_dict, x86_64_var_dict, mips_var_dict, |
125 arm64_var_dict] | 127 mips64_var_dict, arm64_var_dict] |
126 common = vars_dict_lib.intersect(var_dict_list) | 128 common = vars_dict_lib.intersect(var_dict_list) |
127 | 129 |
128 common.LOCAL_MODULE.add('libskia') | 130 common.LOCAL_MODULE.add('libskia') |
129 | 131 |
130 # Create SkUserConfig | 132 # Create SkUserConfig |
131 user_config = os.path.join(SKIA_DIR, 'include', 'config', 'SkUserConfig.h') | 133 user_config = os.path.join(SKIA_DIR, 'include', 'config', 'SkUserConfig.h') |
132 if target_dir: | 134 if target_dir: |
133 dst_dir = target_dir | 135 dst_dir = target_dir |
134 else: | 136 else: |
135 dst_dir = os.path.join(SKIA_DIR, 'include', 'core') | 137 dst_dir = os.path.join(SKIA_DIR, 'include', 'core') |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 arm_var_dict = vars_dict_lib.intersect([arm_var_dict, arm_neon_var_dict]) | 173 arm_var_dict = vars_dict_lib.intersect([arm_var_dict, arm_neon_var_dict]) |
172 | 174 |
173 # Now create a list of VarsDictData holding everything but common. | 175 # Now create a list of VarsDictData holding everything but common. |
174 deviations_from_common = [] | 176 deviations_from_common = [] |
175 deviations_from_common.append(makefile_writer.VarsDictData( | 177 deviations_from_common.append(makefile_writer.VarsDictData( |
176 arm_var_dict, 'arm')) | 178 arm_var_dict, 'arm')) |
177 deviations_from_common.append(makefile_writer.VarsDictData( | 179 deviations_from_common.append(makefile_writer.VarsDictData( |
178 arm_neon_var_dict, 'arm', 'ARCH_ARM_HAVE_NEON')) | 180 arm_neon_var_dict, 'arm', 'ARCH_ARM_HAVE_NEON')) |
179 deviations_from_common.append(makefile_writer.VarsDictData(x86_var_dict, | 181 deviations_from_common.append(makefile_writer.VarsDictData(x86_var_dict, |
180 'x86')) | 182 'x86')) |
181 # Currently, x86_64 is identical to x86 | 183 deviations_from_common.append(makefile_writer.VarsDictData(x86_64_var_dict, |
182 deviations_from_common.append(makefile_writer.VarsDictData(x86_var_dict, | |
183 'x86_64')) | 184 'x86_64')) |
184 | 185 |
185 deviations_from_common.append(makefile_writer.VarsDictData(mips_var_dict, | 186 deviations_from_common.append(makefile_writer.VarsDictData(mips_var_dict, |
186 'mips')) | 187 'mips')) |
187 | 188 |
188 deviations_from_common.append(makefile_writer.VarsDictData(mips64_var_dict, | 189 deviations_from_common.append(makefile_writer.VarsDictData(mips64_var_dict, |
189 'mips64')) | 190 'mips64')) |
190 | 191 |
191 deviations_from_common.append(makefile_writer.VarsDictData(arm64_var_dict, | 192 deviations_from_common.append(makefile_writer.VarsDictData(arm64_var_dict, |
192 'arm64')) | 193 'arm64')) |
193 | 194 |
194 makefile_writer.write_android_mk(target_dir=target_dir, | 195 makefile_writer.write_android_mk(target_dir=target_dir, |
195 common=common, deviations_from_common=deviations_from_common) | 196 common=common, deviations_from_common=deviations_from_common) |
196 | 197 |
197 finally: | 198 finally: |
198 shutil.rmtree(tmp_folder) | 199 shutil.rmtree(tmp_folder) |
199 | 200 |
200 if __name__ == '__main__': | 201 if __name__ == '__main__': |
201 parser = argparse.ArgumentParser() | 202 parser = argparse.ArgumentParser() |
202 parser.add_argument('--gyp_source_dir', help='Source of gyp program. ' | 203 parser.add_argument('--gyp_source_dir', help='Source of gyp program. ' |
203 'e.g. <path_to_skia>/third_party/externals/gyp') | 204 'e.g. <path_to_skia>/third_party/externals/gyp') |
204 args = parser.parse_args() | 205 args = parser.parse_args() |
205 | 206 |
206 main(gyp_source_dir=args.gyp_source_dir) | 207 main(gyp_source_dir=args.gyp_source_dir) |
OLD | NEW |