henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 1 | # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license |
| 4 | # that can be found in the LICENSE file in the root of the source |
| 5 | # tree. An additional intellectual property rights grant can be found |
| 6 | # in the file PATENTS. All contributing project authors may |
| 7 | # be found in the AUTHORS file in the root of the source tree. |
| 8 | { |
| 9 | 'includes': ['build/common.gypi'], |
kjellander@webrtc.org | 3902054 | 2014-09-27 18:10:30 +0000 | [diff] [blame] | 10 | 'targets': [], |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 11 | 'conditions': [ |
| 12 | ['OS=="android"', { |
| 13 | 'targets': [ |
| 14 | { |
| 15 | 'target_name': 'libwebrtcdemo-jni', |
| 16 | 'type': 'loadable_module', |
| 17 | 'dependencies': [ |
| 18 | '<(DEPTH)/third_party/icu/icu.gyp:icuuc', |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 19 | '<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl', |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 20 | '<(webrtc_root)/modules/modules.gyp:video_render_module_internal_impl', |
andresp@webrtc.org | 86e1e48 | 2015-01-14 09:30:52 +0000 | [diff] [blame] | 21 | '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default', |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 22 | '<(webrtc_root)/test/test.gyp:channel_transport', |
| 23 | '<(webrtc_root)/video_engine/video_engine.gyp:video_engine_core', |
| 24 | '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine', |
| 25 | ], |
| 26 | 'sources': [ |
| 27 | 'examples/android/media_demo/jni/jni_helpers.cc', |
| 28 | 'examples/android/media_demo/jni/on_load.cc', |
| 29 | 'examples/android/media_demo/jni/video_engine_jni.cc', |
| 30 | 'examples/android/media_demo/jni/voice_engine_jni.cc', |
| 31 | 'examples/android/media_demo/jni/media_codec_video_decoder.cc', |
| 32 | ], |
phoglund@webrtc.org | 5e3fea1 | 2015-02-24 14:50:53 +0000 | [diff] [blame] | 33 | 'variables': { |
| 34 | # This library uses native JNI exports; tell GYP so that the |
| 35 | # required symbols will be kept. |
| 36 | 'use_native_jni_exports': 1, |
| 37 | }, |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 38 | 'link_settings': { |
| 39 | 'libraries': [ |
| 40 | '-llog', |
| 41 | '-lGLESv2', |
| 42 | '-lOpenSLES', |
| 43 | ], |
| 44 | } |
| 45 | }, |
| 46 | { |
| 47 | 'target_name': 'WebRTCDemo', |
| 48 | 'type': 'none', |
| 49 | 'dependencies': [ |
| 50 | 'libwebrtcdemo-jni', |
| 51 | '<(modules_java_gyp_path):*', |
| 52 | ], |
| 53 | 'actions': [ |
| 54 | { |
| 55 | # TODO(yujie.mao): Convert building of the demo to a proper GYP |
| 56 | # target so this action is not needed once chromium's |
| 57 | # apk-building machinery can be used. (crbug.com/225101) |
| 58 | 'action_name': 'build_webrtcdemo_apk', |
| 59 | 'variables': { |
| 60 | 'android_webrtc_demo_root': '<(webrtc_root)/examples/android/media_demo', |
fischman@webrtc.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 61 | 'ant_log': '../../../<(INTERMEDIATE_DIR)/ant.log', # ../../.. to compensate for the cd below. |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 62 | }, |
| 63 | 'inputs' : [ |
| 64 | '<(PRODUCT_DIR)/lib.java/audio_device_module_java.jar', |
| 65 | '<(PRODUCT_DIR)/lib.java/video_capture_module_java.jar', |
| 66 | '<(PRODUCT_DIR)/lib.java/video_render_module_java.jar', |
| 67 | '<(PRODUCT_DIR)/libwebrtcdemo-jni.so', |
| 68 | '<!@(find <(android_webrtc_demo_root)/src -name "*.java")', |
| 69 | '<!@(find <(android_webrtc_demo_root)/res -type f)', |
| 70 | '<(android_webrtc_demo_root)/AndroidManifest.xml', |
| 71 | '<(android_webrtc_demo_root)/build.xml', |
| 72 | '<(android_webrtc_demo_root)/project.properties', |
| 73 | ], |
| 74 | 'outputs': ['<(PRODUCT_DIR)/WebRTCDemo-debug.apk'], |
fischman@webrtc.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 75 | 'action': [ |
| 76 | 'bash', '-ec', |
| 77 | 'rm -fr <(_outputs) <(android_webrtc_demo_root)/{bin,libs} && ' |
| 78 | 'mkdir -p <(INTERMEDIATE_DIR) && ' # Must happen _before_ the cd below |
| 79 | 'mkdir -p <(android_webrtc_demo_root)/libs/<(android_app_abi) && ' |
| 80 | 'cp <(PRODUCT_DIR)/lib.java/audio_device_module_java.jar <(android_webrtc_demo_root)/libs/ &&' |
| 81 | 'cp <(PRODUCT_DIR)/lib.java/video_capture_module_java.jar <(android_webrtc_demo_root)/libs/ &&' |
| 82 | 'cp <(PRODUCT_DIR)/lib.java/video_render_module_java.jar <(android_webrtc_demo_root)/libs/ &&' |
| 83 | '<(android_strip) -o <(android_webrtc_demo_root)/libs/<(android_app_abi)/libwebrtcdemo-jni.so <(PRODUCT_DIR)/libwebrtcdemo-jni.so && ' |
| 84 | 'cd <(android_webrtc_demo_root) && ' |
kjellander@webrtc.org | 6e105ed | 2014-04-15 08:35:00 +0000 | [diff] [blame] | 85 | '{ ANDROID_SDK_ROOT=<(android_sdk_root) ' |
| 86 | 'ant debug > <(ant_log) 2>&1 || ' |
fischman@webrtc.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 87 | ' { cat <(ant_log) ; exit 1; } } && ' |
| 88 | 'cd - > /dev/null && ' |
| 89 | 'cp <(android_webrtc_demo_root)/bin/WebRTCDemo-debug.apk <(_outputs)' |
| 90 | ], |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 91 | }, |
| 92 | ], |
| 93 | }, |
henrike@webrtc.org | 32c26eb | 2014-01-17 23:12:51 +0000 | [diff] [blame] | 94 | { |
| 95 | 'target_name': 'libopensl-demo-jni', |
| 96 | 'type': 'loadable_module', |
| 97 | 'dependencies': [ |
| 98 | '<(webrtc_root)/modules/modules.gyp:audio_device', |
| 99 | ], |
| 100 | 'sources': [ |
| 101 | 'examples/android/opensl_loopback/jni/opensl_runner.cc', |
| 102 | 'examples/android/opensl_loopback/fake_audio_device_buffer.cc', |
| 103 | ], |
| 104 | 'link_settings': { |
| 105 | 'libraries': [ |
| 106 | '-llog', |
| 107 | '-lOpenSLES', |
| 108 | ], |
| 109 | }, |
| 110 | }, |
| 111 | { |
| 112 | 'target_name': 'OpenSlDemo', |
| 113 | 'type': 'none', |
| 114 | 'dependencies': [ |
| 115 | 'libopensl-demo-jni', |
| 116 | '<(modules_java_gyp_path):*', |
| 117 | ], |
| 118 | 'actions': [ |
| 119 | { |
| 120 | # TODO(henrik): Convert building of the demo to a proper GYP |
| 121 | # target so this action is not needed once chromium's |
| 122 | # apk-building machinery can be used. (crbug.com/225101) |
| 123 | 'action_name': 'build_opensldemo_apk', |
| 124 | 'variables': { |
| 125 | 'android_opensl_demo_root': '<(webrtc_root)/examples/android/opensl_loopback', |
| 126 | 'ant_log': '../../../<(INTERMEDIATE_DIR)/ant.log', # ../../.. to compensate for the cd below. |
| 127 | }, |
| 128 | 'inputs' : [ |
| 129 | '<(PRODUCT_DIR)/lib.java/audio_device_module_java.jar', |
| 130 | '<(PRODUCT_DIR)/libopensl-demo-jni.so', |
| 131 | '<!@(find <(android_opensl_demo_root)/src -name "*.java")', |
| 132 | '<!@(find <(android_opensl_demo_root)/res -name "*.xml")', |
| 133 | '<!@(find <(android_opensl_demo_root)/res -name "*.png")', |
| 134 | '<(android_opensl_demo_root)/AndroidManifest.xml', |
| 135 | '<(android_opensl_demo_root)/build.xml', |
| 136 | '<(android_opensl_demo_root)/project.properties', |
| 137 | ], |
| 138 | 'outputs': ['<(PRODUCT_DIR)/OpenSlDemo-debug.apk'], |
| 139 | 'action': [ |
| 140 | 'bash', '-ec', |
kjellander@webrtc.org | a781f68 | 2014-09-06 22:11:28 +0000 | [diff] [blame] | 141 | 'rm -fr <(_outputs) <(android_opensl_demo_root)/{bin,libs} && ' |
henrike@webrtc.org | 32c26eb | 2014-01-17 23:12:51 +0000 | [diff] [blame] | 142 | 'mkdir -p <(android_opensl_demo_root)/libs/<(android_app_abi) && ' |
| 143 | 'mkdir -p <(INTERMEDIATE_DIR) && ' # Must happen _before_ the cd below |
| 144 | '<(android_strip) -o <(android_opensl_demo_root)/libs/<(android_app_abi)/libopensl-demo-jni.so <(PRODUCT_DIR)/libopensl-demo-jni.so && ' |
| 145 | 'cp <(PRODUCT_DIR)/lib.java/audio_device_module_java.jar <(android_opensl_demo_root)/libs/ &&' |
| 146 | 'cd <(android_opensl_demo_root) && ' |
kjellander@webrtc.org | 6e105ed | 2014-04-15 08:35:00 +0000 | [diff] [blame] | 147 | '{ ANDROID_SDK_ROOT=<(android_sdk_root) ' |
| 148 | 'ant debug > <(ant_log) 2>&1 || ' |
henrike@webrtc.org | 32c26eb | 2014-01-17 23:12:51 +0000 | [diff] [blame] | 149 | ' { cat <(ant_log) ; exit 1; } } && ' |
| 150 | 'cd - > /dev/null && ' |
| 151 | 'cp <(android_opensl_demo_root)/bin/OpenSlDemo-debug.apk <(_outputs)' |
| 152 | ], |
| 153 | }, |
| 154 | ], |
| 155 | }, |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 156 | ], |
| 157 | }], |
| 158 | ], |
| 159 | } |