2015-06-12 19:51:44 +00:00
|
|
|
# Copyright 2015 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# This GYP file stores the dependencies necessary to build Skia on the Android
|
|
|
|
# platform. The OS doesn't provide many stable libraries as part of the
|
|
|
|
# distribution so we have to build a few of them ourselves.
|
2015-02-12 18:48:25 +00:00
|
|
|
#
|
2013-04-29 12:09:31 +00:00
|
|
|
{
|
2015-06-12 19:51:44 +00:00
|
|
|
'variables': {
|
|
|
|
'conditions': [
|
|
|
|
[ 'skia_arch_type == "arm" and arm_version != 7', {
|
|
|
|
'android_arch%': "armeabi",
|
2015-07-24 20:15:58 +00:00
|
|
|
'android_variant%': "arm",
|
2015-06-12 19:51:44 +00:00
|
|
|
}],
|
|
|
|
[ 'skia_arch_type == "arm" and arm_version == 7', {
|
|
|
|
'android_arch%': "armeabi-v7a",
|
2015-07-24 20:15:58 +00:00
|
|
|
'android_variant%': "arm",
|
2015-06-12 19:51:44 +00:00
|
|
|
}],
|
|
|
|
[ 'skia_arch_type == "arm64"', {
|
|
|
|
'android_arch%': "arm64-v8a",
|
2015-07-24 20:15:58 +00:00
|
|
|
'android_variant%': "arm64",
|
2015-06-12 19:51:44 +00:00
|
|
|
}],
|
|
|
|
[ 'skia_arch_type == "x86"', {
|
|
|
|
'android_arch%': "x86",
|
2015-07-24 20:15:58 +00:00
|
|
|
'android_variant%': "x86",
|
2015-06-12 19:51:44 +00:00
|
|
|
}],
|
|
|
|
[ 'skia_arch_type == "x86_64"', {
|
|
|
|
'android_arch%': "x86_64",
|
2015-07-24 20:15:58 +00:00
|
|
|
'android_variant%': "x86_64",
|
2015-06-12 19:51:44 +00:00
|
|
|
}],
|
2015-07-27 13:10:36 +00:00
|
|
|
[ 'skia_arch_type == "mips32"', {
|
2015-06-12 19:51:44 +00:00
|
|
|
'android_arch%': "mips",
|
2015-07-24 20:15:58 +00:00
|
|
|
'android_variant%': "mips",
|
2015-06-12 19:51:44 +00:00
|
|
|
}],
|
2015-07-27 13:10:36 +00:00
|
|
|
[ 'skia_arch_type == "mips64"', {
|
2015-06-12 19:51:44 +00:00
|
|
|
'android_arch%': "mips64",
|
2015-07-24 20:15:58 +00:00
|
|
|
'android_variant%': "mips64",
|
2015-06-12 19:51:44 +00:00
|
|
|
}],
|
2015-07-31 17:25:17 +00:00
|
|
|
[ 'android_buildtype == "Release"', {
|
2015-08-10 15:58:03 +00:00
|
|
|
'android_apk_suffix': "release.apk",
|
2015-07-31 17:25:17 +00:00
|
|
|
}, {
|
|
|
|
'android_apk_suffix': "debug.apk",
|
|
|
|
}],
|
2015-06-12 19:51:44 +00:00
|
|
|
],
|
|
|
|
},
|
2015-09-23 19:40:34 +00:00
|
|
|
'includes' : [ 'canvasproof.gypi', ],
|
2013-04-29 12:09:31 +00:00
|
|
|
'targets': [
|
|
|
|
{
|
2013-08-12 12:30:04 +00:00
|
|
|
'target_name': 'CopySampleAppDeps',
|
2013-04-29 12:09:31 +00:00
|
|
|
'type': 'none',
|
|
|
|
'dependencies': [
|
2013-06-03 12:10:19 +00:00
|
|
|
'skia_lib.gyp:skia_lib',
|
2013-04-29 12:09:31 +00:00
|
|
|
'SampleApp.gyp:SampleApp',
|
|
|
|
],
|
|
|
|
'copies': [
|
|
|
|
# Copy all shared libraries into the Android app's libs folder. Note
|
|
|
|
# that this copy requires us to build SkiaAndroidApp after those
|
|
|
|
# libraries, so that they exist by the time it occurs. If there are no
|
|
|
|
# libraries to copy, this will cause an error in Make, but the app will
|
|
|
|
# still build.
|
|
|
|
{
|
2015-07-24 20:15:58 +00:00
|
|
|
'destination': '<(android_base)/apps/sample_app/src/main/libs/<(android_arch)',
|
2013-12-02 13:50:38 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'skia_shared_lib', {
|
|
|
|
'files': [
|
|
|
|
'<(SHARED_LIB_DIR)/libSampleApp.so',
|
|
|
|
'<(SHARED_LIB_DIR)/libskia_android.so',
|
|
|
|
]}, {
|
|
|
|
'files': [
|
|
|
|
'<(SHARED_LIB_DIR)/libSampleApp.so',
|
|
|
|
]}
|
|
|
|
],
|
2013-04-29 12:09:31 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2013-08-12 12:30:04 +00:00
|
|
|
'target_name': 'SampleApp_APK',
|
2013-04-29 12:09:31 +00:00
|
|
|
'type': 'none',
|
|
|
|
'dependencies': [
|
2013-08-12 12:30:04 +00:00
|
|
|
'CopySampleAppDeps',
|
2013-04-29 12:09:31 +00:00
|
|
|
],
|
|
|
|
'actions': [
|
|
|
|
{
|
2015-06-18 20:08:26 +00:00
|
|
|
'action_name': 'SampleApp_apk',
|
2013-04-29 12:09:31 +00:00
|
|
|
'inputs': [
|
2015-07-24 20:15:58 +00:00
|
|
|
'<(android_base)/apps/sample_app/src/main/AndroidManifest.xml',
|
|
|
|
'<(android_base)/apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.h',
|
|
|
|
'<(android_base)/apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.cpp',
|
|
|
|
'<(android_base)/apps/sample_app/src/main/java/com/skia/SkiaSampleActivity.java',
|
|
|
|
'<(android_base)/apps/sample_app/src/main/java/com/skia/SkiaSampleRenderer.java',
|
|
|
|
'<(android_base)/apps/sample_app/src/main/java/com/skia/SkiaSampleView.java',
|
2015-07-31 13:33:21 +00:00
|
|
|
'<(android_base)/apps/sample_app/src/main/libs/<(android_arch)/libSampleApp.so',
|
|
|
|
],
|
|
|
|
'conditions': [
|
|
|
|
[ 'skia_shared_lib', {
|
|
|
|
'inputs': [
|
|
|
|
'<(android_base)/apps/sample_app/src/main/libs/<(android_arch)/libskia_android.so',
|
|
|
|
],
|
|
|
|
}],
|
2013-04-29 12:09:31 +00:00
|
|
|
],
|
|
|
|
'outputs': [
|
2015-07-31 17:25:17 +00:00
|
|
|
'<(android_base)/apps/sample_app/build/outputs/apk/sample_app-<(android_variant)-<(android_apk_suffix)',
|
2013-04-29 12:09:31 +00:00
|
|
|
],
|
|
|
|
'action': [
|
2015-07-24 20:15:58 +00:00
|
|
|
'<(android_base)/apps/gradlew',
|
2015-07-31 17:25:17 +00:00
|
|
|
':sample_app:assemble<(android_variant)<(android_buildtype)',
|
2015-07-24 20:15:58 +00:00
|
|
|
'-p<(android_base)/apps/sample_app',
|
|
|
|
'-PsuppressNativeBuild',
|
2013-04-29 12:09:31 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2015-06-12 19:51:44 +00:00
|
|
|
{
|
|
|
|
'target_name': 'CopyVisualBenchDeps',
|
|
|
|
'type': 'none',
|
|
|
|
'dependencies': [
|
|
|
|
'skia_lib.gyp:skia_lib',
|
|
|
|
'visualbench.gyp:visualbench',
|
|
|
|
],
|
|
|
|
|
|
|
|
'copies': [
|
|
|
|
# Copy all shared libraries into the Android app's libs folder. Note
|
|
|
|
# that this copy requires us to build SkiaAndroidApp after those
|
|
|
|
# libraries, so that they exist by the time it occurs. If there are no
|
|
|
|
# libraries to copy, this will cause an error in Make, but the app will
|
|
|
|
# still build.
|
|
|
|
{
|
2015-07-24 20:15:58 +00:00
|
|
|
'destination': '<(android_base)/apps/visualbench/src/main/libs/<(android_arch)',
|
2015-06-12 19:51:44 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'skia_shared_lib', {
|
|
|
|
'files': [
|
|
|
|
'<(SHARED_LIB_DIR)/libskia_android.so',
|
|
|
|
'<(SHARED_LIB_DIR)/libvisualbench.so',
|
|
|
|
]}, {
|
|
|
|
'files': [
|
|
|
|
'<(SHARED_LIB_DIR)/libvisualbench.so',
|
|
|
|
]}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'target_name': 'VisualBench_APK',
|
|
|
|
'type': 'none',
|
|
|
|
'dependencies': [
|
|
|
|
'CopyVisualBenchDeps',
|
|
|
|
],
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'SkiaVisualBench_apk',
|
|
|
|
'inputs': [
|
2015-07-24 20:15:58 +00:00
|
|
|
'<(android_base)/apps/visualbench/src/main/AndroidManifest.xml',
|
|
|
|
'<(android_base)/apps/visualbench/src/main/java/com/skia/VisualBenchActivity.java',
|
2015-07-31 13:33:21 +00:00
|
|
|
'<(android_base)/apps/visualbench/src/main/libs/<(android_arch)/libvisualbench.so',
|
|
|
|
],
|
|
|
|
'conditions': [
|
|
|
|
[ 'skia_shared_lib', {
|
|
|
|
'inputs': [
|
|
|
|
'<(android_base)/apps/visualbench/src/main/libs/<(android_arch)/libskia_android.so',
|
|
|
|
],
|
|
|
|
}],
|
2015-06-12 19:51:44 +00:00
|
|
|
],
|
|
|
|
'outputs': [
|
2015-07-31 17:25:17 +00:00
|
|
|
'<(android_base)/apps/visualbench/build/outputs/apk/visualbench-<(android_variant)-<(android_apk_suffix)',
|
2015-06-12 19:51:44 +00:00
|
|
|
],
|
|
|
|
'action': [
|
2015-07-24 20:15:58 +00:00
|
|
|
'<(android_base)/apps/gradlew',
|
2015-07-31 17:25:17 +00:00
|
|
|
':visualbench:assemble<(android_variant)<(android_buildtype)',
|
2015-07-24 20:15:58 +00:00
|
|
|
'-p<(android_base)/apps/visualbench',
|
|
|
|
'-PsuppressNativeBuild',
|
2015-06-12 19:51:44 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2015-08-19 19:06:46 +00:00
|
|
|
{
|
|
|
|
'target_name': 'VisualBenchTest_APK',
|
|
|
|
'type': 'none',
|
|
|
|
'dependencies': [
|
|
|
|
'VisualBench_APK',
|
|
|
|
],
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'SkiaVisualBench_apk',
|
|
|
|
'inputs': [
|
|
|
|
'<(android_base)/apps/visualbench/src/main/AndroidManifest.xml',
|
|
|
|
'<(android_base)/apps/visualbench/src/main/java/com/skia/VisualBenchActivity.java',
|
|
|
|
'<(android_base)/apps/visualbench/src/main/java/com/skia/VisualBenchTestActivity.java',
|
|
|
|
'<(android_base)/apps/visualbench/src/main/libs/<(android_arch)/libvisualbench.so',
|
|
|
|
],
|
|
|
|
'conditions': [
|
|
|
|
[ 'skia_shared_lib', {
|
|
|
|
'inputs': [
|
|
|
|
'<(android_base)/apps/visualbench/src/main/libs/<(android_arch)/libskia_android.so',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(android_base)/apps/visualbench/build/outputs/apk/visualbench-<(android_variant)-debug-androidTest-unaligned.apk',
|
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'<(android_base)/apps/gradlew',
|
|
|
|
':visualbench:assemble<(android_variant)DebugAndroidTest',
|
|
|
|
'-p<(android_base)/apps/visualbench',
|
|
|
|
'-PsuppressNativeBuild',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2015-11-05 19:49:35 +00:00
|
|
|
# TODO all of this duplicated code can be removed when SDL becomes the default
|
|
|
|
# Currently, to use this you have to override skia_use_sdl
|
|
|
|
{
|
|
|
|
'target_name': 'CopyVisualBenchSDLDeps',
|
|
|
|
'type': 'none',
|
|
|
|
'dependencies': [
|
|
|
|
'skia_lib.gyp:skia_lib',
|
|
|
|
'visualbench.gyp:visualbench',
|
|
|
|
],
|
|
|
|
|
|
|
|
'copies': [
|
|
|
|
# Copy all shared libraries into the Android app's libs folder. Note
|
|
|
|
# that this copy requires us to build SkiaAndroidApp after those
|
|
|
|
# libraries, so that they exist by the time it occurs. If there are no
|
|
|
|
# libraries to copy, this will cause an error in Make, but the app will
|
|
|
|
# still build.
|
|
|
|
{
|
|
|
|
'destination': '<(android_base)/apps/visualbenchsdl/src/main/libs/<(android_arch)',
|
|
|
|
'conditions': [
|
|
|
|
[ 'skia_shared_lib', {
|
|
|
|
'files': [
|
|
|
|
'<(SHARED_LIB_DIR)/libskia_android.so',
|
|
|
|
'<(SHARED_LIB_DIR)/libvisualbench.so',
|
|
|
|
]}, {
|
|
|
|
'files': [
|
|
|
|
'<(SHARED_LIB_DIR)/libvisualbench.so',
|
|
|
|
]}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'target_name': 'VisualBenchSDL_APK',
|
|
|
|
'type': 'none',
|
|
|
|
'dependencies': [
|
|
|
|
'CopyVisualBenchSDLDeps',
|
|
|
|
],
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'SkiaVisualBenchSDL_apk',
|
|
|
|
'inputs': [
|
|
|
|
'<(android_base)/apps/visualbenchsdl/src/main/AndroidManifest.xml',
|
|
|
|
'<(android_base)/apps/visualbenchsdl/src/main/java/org/libsdl/app/SDLActivity.java',
|
|
|
|
'<(android_base)/apps/visualbenchsdl/src/main/java/com/skia/VisualBenchActivity.java',
|
|
|
|
'<(android_base)/apps/visualbenchsdl/src/main/libs/<(android_arch)/libvisualbench.so',
|
|
|
|
],
|
|
|
|
'conditions': [
|
|
|
|
[ 'skia_shared_lib', {
|
|
|
|
'inputs': [
|
|
|
|
'<(android_base)/apps/visualbenchsdl/src/main/libs/<(android_arch)/libskia_android.so',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(android_base)/apps/visualbenchsdl/build/outputs/apk/visualbench-<(android_variant)-<(android_apk_suffix)',
|
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'<(android_base)/apps/gradlew',
|
|
|
|
':visualbenchsdl:assemble<(android_variant)<(android_buildtype)',
|
|
|
|
'-p<(android_base)/apps/visualbenchsdl',
|
|
|
|
'-PsuppressNativeBuild',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2013-04-29 12:09:31 +00:00
|
|
|
],
|
|
|
|
}
|