Index: platform_tools/android/bin/gyp_to_android.py |
diff --git a/platform_tools/android/bin/gyp_to_android.py b/platform_tools/android/bin/gyp_to_android.py |
index a42471b2e03e5101645ce9645d742956c1cc2892..34c81e1f5e38c7ca23fbfdf4b573cde7cc69f964 100755 |
--- a/platform_tools/android/bin/gyp_to_android.py |
+++ b/platform_tools/android/bin/gyp_to_android.py |
@@ -35,7 +35,8 @@ import gyp_gen.vars_dict_lib as vars_dict_lib |
GYP_FOLDER = 'gyp' |
-def generate_var_dict(target_dir, target_file, skia_arch_type, have_neon): |
+def generate_var_dict(target_dir, target_file, skia_arch_type, have_neon, |
+ gyp_source_dir): |
"""Create a VarsDict for a particular arch type. |
Each paramater is passed directly to android_framework_gyp.main(). |
@@ -45,18 +46,20 @@ def generate_var_dict(target_dir, target_file, skia_arch_type, have_neon): |
target_file: Target gyp file. |
skia_arch_type: Target architecture. |
have_neon: Whether the target should build for neon. |
+ gyp_source_dir: Directory for gyp source. |
Returns: |
A VarsDict containing the variable definitions determined by gyp. |
""" |
result_file = android_framework_gyp.main(target_dir, target_file, |
- skia_arch_type, have_neon) |
+ skia_arch_type, have_neon, |
+ gyp_source_dir) |
var_dict = vars_dict_lib.VarsDict() |
gypd_parser.parse_gypd(var_dict, result_file, '.') |
android_framework_gyp.clean_gypd_files(target_dir) |
print '.', |
return var_dict |
-def main(target_dir=None, require_sk_user_config=False): |
+def main(target_dir=None, require_sk_user_config=False, gyp_source_dir=None): |
"""Create Android.mk for the Android framework's external/skia. |
Builds Android.mk using Skia's gyp files. |
@@ -66,6 +69,7 @@ def main(target_dir=None, require_sk_user_config=False): |
will be placed in skia's root directory. |
require_sk_user_config: If True, raise an AssertionError if |
SkUserConfig.h does not exist. |
+ gyp_source_dir: Source directory for gyp. |
""" |
# Create a temporary folder to hold gyp and gypd files. Create it in SKIA_DIR |
# so that it is a sibling of gyp/, so the relationships between gyp files and |
@@ -95,19 +99,22 @@ def main(target_dir=None, require_sk_user_config=False): |
# The default uses a non-existant archtype, to find all the general |
# variable definitions. |
default_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'other', |
- False) |
- arm_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm', False) |
+ False, gyp_source_dir) |
+ arm_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm', False, |
+ gyp_source_dir) |
arm_neon_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm', |
- True) |
- x86_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'x86', False) |
+ True, gyp_source_dir) |
+ x86_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'x86', False, |
+ gyp_source_dir) |
- mips_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'mips', False) |
+ mips_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'mips', False, |
+ gyp_source_dir) |
mips64_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'mips64', |
- False) |
+ False, gyp_source_dir) |
arm64_var_dict = generate_var_dict(tmp_folder, main_gyp_file, 'arm64', |
- False) |
+ False, gyp_source_dir) |
# Compute the intersection of all targets. All the files in the intersection |
# should be part of the makefile always. Each dict will now contain trimmed |