aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2014-07-01 08:02:30 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-01 08:02:30 -0700
commit950f89dd20325bf4dfce588d9f64644040787a06 (patch)
treeb43b944a77de536d41bc4f46c27a33fc27d3fef8
parentec2ae5878d0c4fe3492b6866eaa3b946e526f1a3 (diff)
Specify the name of tool for creating a makefile.
When generating tool Android.mks from gyp files, specify the name of the target needed. This fixes a bug where nanobench was being added to the same makefile as bench, which would not compile. TODO: Make gyp_to_android more general, so that it handles this case better. See http://skbug.com/2709 R=mtklein@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/366653002
-rwxr-xr-xplatform_tools/android/bin/gyp_to_android.py10
-rw-r--r--platform_tools/android/gyp_gen/tool_makefile_writer.py4
2 files changed, 10 insertions, 4 deletions
diff --git a/platform_tools/android/bin/gyp_to_android.py b/platform_tools/android/bin/gyp_to_android.py
index 4015c38919..0719543dd6 100755
--- a/platform_tools/android/bin/gyp_to_android.py
+++ b/platform_tools/android/bin/gyp_to_android.py
@@ -137,7 +137,8 @@ def main(target_dir=None, require_sk_user_config=False):
dest_dir='tests',
skia_lib_var_dict=common,
local_module_name='skia_test',
- local_module_tags=['tests'])
+ local_module_tags=['tests'],
+ desired_targets=['tests'])
tool_makefile_writer.generate_tool(gyp_dir=tmp_folder,
target_file='bench.gyp',
@@ -146,6 +147,7 @@ def main(target_dir=None, require_sk_user_config=False):
skia_lib_var_dict=common,
local_module_name='skia_bench',
local_module_tags=['tests'],
+ desired_targets=['bench'],
place_in_local_tmp=True)
tool_makefile_writer.generate_tool(gyp_dir=tmp_folder,
@@ -154,7 +156,8 @@ def main(target_dir=None, require_sk_user_config=False):
dest_dir='gm',
skia_lib_var_dict=common,
local_module_name='skia_gm',
- local_module_tags=['tests'])
+ local_module_tags=['tests'],
+ desired_targets=['gm'])
tool_makefile_writer.generate_tool(gyp_dir=tmp_folder,
target_file='dm.gyp',
@@ -162,7 +165,8 @@ def main(target_dir=None, require_sk_user_config=False):
dest_dir='dm',
skia_lib_var_dict=common,
local_module_name='skia_dm',
- local_module_tags=['tests'])
+ local_module_tags=['tests'],
+ desired_targets=['dm'])
# Now that the defines have been written to SkUserConfig and they've been
# used to skip adding them to the tools makefiles, they are not needed in
diff --git a/platform_tools/android/gyp_gen/tool_makefile_writer.py b/platform_tools/android/gyp_gen/tool_makefile_writer.py
index ac2a75857e..5579b8609f 100644
--- a/platform_tools/android/gyp_gen/tool_makefile_writer.py
+++ b/platform_tools/android/gyp_gen/tool_makefile_writer.py
@@ -45,6 +45,7 @@ def write_tool_android_mk(target_dir, var_dict, place_in_local_tmp):
def generate_tool(gyp_dir, target_file, skia_trunk, dest_dir,
skia_lib_var_dict, local_module_name, local_module_tags,
+ desired_targets,
place_in_local_tmp=False):
"""Common steps for building one of the skia tools.
@@ -62,6 +63,7 @@ def generate_tool(gyp_dir, target_file, skia_trunk, dest_dir,
ensure we do not duplicate anything in this Android.mk.
local_module_name: Name for this tool, to set as LOCAL_MODULE.
local_module_tags: Tags to pass to LOCAL_MODULE_TAG.
+ desired_targets: List of targets to parse.
place_in_local_tmp: If True, the executable will be synced to
/data/local/tmp.
"""
@@ -75,7 +77,7 @@ def generate_tool(gyp_dir, target_file, skia_trunk, dest_dir,
# Add known targets from skia_lib, so we do not reparse them.
var_dict.KNOWN_TARGETS.set(skia_lib_var_dict.KNOWN_TARGETS)
- gypd_parser.parse_gypd(var_dict, result_file, dest_dir)
+ gypd_parser.parse_gypd(var_dict, result_file, dest_dir, desired_targets)
android_framework_gyp.clean_gypd_files(gyp_dir)