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