aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools/android/bin
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2014-12-11 13:05:14 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-11 13:05:14 -0800
commit60936c732b1d21940a21a95f5757ae24c666877b (patch)
treeb30d28c09ced0d2ee737cb3fafbbcef74ec5b409 /platform_tools/android/bin
parentf55c314bfa6db980941f8d0ab485beb2e08589ab (diff)
Add parameter to specify gyp dir to gyp_to_android.
NOTRY=true NOTREECHECKS=True BUG=skia:3233 Review URL: https://codereview.chromium.org/800573002
Diffstat (limited to 'platform_tools/android/bin')
-rwxr-xr-xplatform_tools/android/bin/gyp_to_android.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/platform_tools/android/bin/gyp_to_android.py b/platform_tools/android/bin/gyp_to_android.py
index a42471b2e0..34c81e1f5e 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