| OLD | NEW |
| 1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| 2 # | 2 # |
| 3 # Use of this source code is governed by a BSD-style license | 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 | 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 | 5 # tree. An additional intellectual property rights grant can be found |
| 6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
| 7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
| 8 | 8 |
| 9 import("//webrtc/webrtc.gni") | 9 import("//webrtc/webrtc.gni") |
| 10 import("//build/config/android/config.gni") | 10 import("//build/config/android/config.gni") |
| 11 import("//build/config/android/rules.gni") | 11 import("//build/config/android/rules.gni") |
| 12 | 12 |
| 13 config("libjingle_peerconnection_jni_warnings_config") { | 13 config("libjingle_peerconnection_jni_warnings_config") { |
| 14 # The warnings below are enabled by default. Since GN orders compiler flags | 14 # The warnings below are enabled by default. Since GN orders compiler flags |
| 15 # for a target before flags from configs, the only way to disable such | 15 # for a target before flags from configs, the only way to disable such |
| 16 # warnings is by having them in a separate config, loaded from the target. | 16 # warnings is by having them in a separate config, loaded from the target. |
| 17 if (!is_win) { | 17 if (!is_win) { |
| 18 cflags = [ | 18 cflags = [ |
| 19 "-Wno-sign-compare", | 19 "-Wno-sign-compare", |
| 20 "-Wno-unused-variable", | 20 "-Wno-unused-variable", |
| 21 ] | 21 ] |
| 22 } | 22 } |
| 23 } | 23 } |
| 24 | 24 |
| 25 rtc_static_library("libjingle_peerconnection_jni") { | 25 rtc_static_library("libjingle_peerconnection_jni") { |
| 26 public_deps = [ |
| 27 ":audio_jni", |
| 28 ":base_jni", |
| 29 ":peerconnection_jni", |
| 30 ":video_jni", |
| 31 ] |
| 32 } |
| 33 |
| 34 rtc_static_library("base_jni") { |
| 35 sources = [ |
| 36 "src/jni/androidmediacodeccommon.h", |
| 37 "src/jni/classreferenceholder.cc", |
| 38 "src/jni/classreferenceholder.h", |
| 39 "src/jni/jni_helpers.cc", |
| 40 "src/jni/jni_helpers.h", |
| 41 "src/jni/ownedfactoryandthreads.cc", |
| 42 "src/jni/ownedfactoryandthreads.h", |
| 43 ] |
| 44 |
| 45 deps = [ |
| 46 "//webrtc/api:libjingle_peerconnection_api", |
| 47 "//webrtc/base:rtc_base", |
| 48 "//webrtc/base:rtc_base_approved", |
| 49 ] |
| 50 |
| 51 if (is_clang) { |
| 52 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 53 suppressed_configs += [ |
| 54 "//build/config/clang:extra_warnings", |
| 55 "//build/config/clang:find_bad_constructs", |
| 56 ] |
| 57 } |
| 58 } |
| 59 |
| 60 rtc_static_library("audio_jni") { |
| 61 deps = [ |
| 62 ":base_jni", |
| 63 "//webrtc/voice_engine:voice_engine", |
| 64 ] |
| 65 } |
| 66 |
| 67 rtc_static_library("video_jni") { |
| 26 sources = [ | 68 sources = [ |
| 27 "src/jni/androidhistogram_jni.cc", | 69 "src/jni/androidhistogram_jni.cc", |
| 28 "src/jni/androidmediacodeccommon.h", | |
| 29 "src/jni/androidmediadecoder_jni.cc", | 70 "src/jni/androidmediadecoder_jni.cc", |
| 30 "src/jni/androidmediadecoder_jni.h", | 71 "src/jni/androidmediadecoder_jni.h", |
| 31 "src/jni/androidmediaencoder_jni.cc", | 72 "src/jni/androidmediaencoder_jni.cc", |
| 32 "src/jni/androidmediaencoder_jni.h", | 73 "src/jni/androidmediaencoder_jni.h", |
| 33 "src/jni/androidnetworkmonitor_jni.cc", | |
| 34 "src/jni/androidnetworkmonitor_jni.h", | |
| 35 "src/jni/androidvideotracksource.cc", | 74 "src/jni/androidvideotracksource.cc", |
| 36 "src/jni/androidvideotracksource.h", | 75 "src/jni/androidvideotracksource.h", |
| 37 "src/jni/androidvideotracksource_jni.cc", | 76 "src/jni/androidvideotracksource_jni.cc", |
| 38 "src/jni/classreferenceholder.cc", | |
| 39 "src/jni/classreferenceholder.h", | |
| 40 "src/jni/jni_helpers.cc", | |
| 41 "src/jni/jni_helpers.h", | |
| 42 "src/jni/native_handle_impl.cc", | 77 "src/jni/native_handle_impl.cc", |
| 43 "src/jni/native_handle_impl.h", | 78 "src/jni/native_handle_impl.h", |
| 44 "src/jni/peerconnection_jni.cc", | |
| 45 "src/jni/rtcstatscollectorcallbackwrapper.cc", | |
| 46 "src/jni/rtcstatscollectorcallbackwrapper.h", | |
| 47 "src/jni/surfacetexturehelper_jni.cc", | 79 "src/jni/surfacetexturehelper_jni.cc", |
| 48 "src/jni/surfacetexturehelper_jni.h", | 80 "src/jni/surfacetexturehelper_jni.h", |
| 81 "src/jni/video_jni.cc", |
| 82 "src/jni/video_renderer_jni.cc", |
| 49 ] | 83 ] |
| 50 | 84 |
| 51 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] | 85 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
| 52 | 86 |
| 53 if (is_clang) { | 87 if (is_clang) { |
| 54 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 88 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 55 suppressed_configs += [ | 89 suppressed_configs += [ |
| 56 "//build/config/clang:extra_warnings", | 90 "//build/config/clang:extra_warnings", |
| 57 "//build/config/clang:find_bad_constructs", | 91 "//build/config/clang:find_bad_constructs", |
| 58 ] | 92 ] |
| 59 } | 93 } |
| 60 | 94 |
| 61 # TODO(jschuh): Bug 1348: fix this warning. | 95 # TODO(jschuh): Bug 1348: fix this warning. |
| 62 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | 96 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 63 | 97 |
| 64 if (is_win) { | 98 if (is_win) { |
| 65 cflags += [ | 99 cflags += [ |
| 66 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. | 100 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. |
| 67 "/wd4389", # signed/unsigned mismatch. | 101 "/wd4389", # signed/unsigned mismatch. |
| 68 ] | 102 ] |
| 69 } | 103 } |
| 70 | 104 |
| 71 deps = [ | 105 deps = [ |
| 72 "../..:webrtc_common", | 106 ":base_jni", |
| 73 "../../api:video_frame_api", | 107 "//webrtc:webrtc_common", |
| 74 "../../api/video_codecs:video_codecs_api", | 108 "//webrtc/api:libjingle_peerconnection_api", |
| 75 "../../base:rtc_base", | 109 "//webrtc/api:video_frame_api", |
| 76 "../../base:rtc_base_approved", | 110 "//webrtc/api/video_codecs:video_codecs_api", |
| 77 "../../base:rtc_task_queue", | 111 "//webrtc/base:rtc_base", |
| 78 "../../base:sequenced_task_checker", | 112 "//webrtc/base:rtc_base_approved", |
| 79 "../../base:weak_ptr", | 113 "//webrtc/base:rtc_task_queue", |
| 80 "../../common_video:common_video", | 114 "//webrtc/base:sequenced_task_checker", |
| 81 "../../media:rtc_media", | 115 "//webrtc/base:weak_ptr", |
| 82 "../../media:rtc_media_base", | 116 "//webrtc/common_video:common_video", |
| 83 "../../modules/utility:utility", | 117 "//webrtc/media:rtc_audio_video", |
| 84 "../../modules/video_coding:video_coding_utility", | 118 "//webrtc/media:rtc_media_base_data", |
| 85 "../../system_wrappers:system_wrappers", | 119 "//webrtc/modules/utility:utility", |
| 86 "../../voice_engine:voice_engine", | 120 "//webrtc/modules/video_coding:video_coding_utility", |
| 87 "//webrtc/pc:libjingle_peerconnection", | 121 "//webrtc/system_wrappers:system_wrappers", |
| 88 ] | 122 ] |
| 89 | 123 |
| 90 if (rtc_build_libyuv) { | 124 if (rtc_build_libyuv) { |
| 91 deps += [ "$rtc_libyuv_dir" ] | 125 deps += [ "$rtc_libyuv_dir" ] |
| 92 public_deps = [ | 126 public_deps = [ |
| 93 "$rtc_libyuv_dir", | 127 "$rtc_libyuv_dir", |
| 94 ] | 128 ] |
| 95 } else { | 129 } else { |
| 96 # Need to add a directory normally exported by libyuv. | 130 # Need to add a directory normally exported by libyuv. |
| 97 include_dirs = [ "$rtc_libyuv_dir/include" ] | 131 include_dirs = [ "$rtc_libyuv_dir/include" ] |
| 98 } | 132 } |
| 99 } | 133 } |
| 100 | 134 |
| 135 rtc_static_library("null_video_jni") { |
| 136 sources = [ |
| 137 "src/jni/null_video_jni.cc", |
| 138 ] |
| 139 |
| 140 deps = [ |
| 141 ":base_jni", |
| 142 "//webrtc/base:rtc_base_approved", |
| 143 ] |
| 144 |
| 145 if (is_clang) { |
| 146 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 147 suppressed_configs += [ |
| 148 "//build/config/clang:extra_warnings", |
| 149 "//build/config/clang:find_bad_constructs", |
| 150 ] |
| 151 } |
| 152 } |
| 153 |
| 154 rtc_static_library("peerconnection_jni") { |
| 155 sources = [ |
| 156 "src/jni/androidnetworkmonitor_jni.cc", |
| 157 "src/jni/androidnetworkmonitor_jni.h", |
| 158 "src/jni/peerconnection_jni.cc", |
| 159 "src/jni/rtcstatscollectorcallbackwrapper.cc", |
| 160 "src/jni/rtcstatscollectorcallbackwrapper.h", |
| 161 ] |
| 162 |
| 163 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
| 164 |
| 165 if (is_clang) { |
| 166 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 167 suppressed_configs += [ |
| 168 "//build/config/clang:extra_warnings", |
| 169 "//build/config/clang:find_bad_constructs", |
| 170 ] |
| 171 } |
| 172 |
| 173 # TODO(jschuh): Bug 1348: fix this warning. |
| 174 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 175 |
| 176 if (is_win) { |
| 177 cflags += [ |
| 178 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. |
| 179 "/wd4389", # signed/unsigned mismatch. |
| 180 ] |
| 181 } |
| 182 |
| 183 deps = [ |
| 184 ":base_jni", |
| 185 "../..:webrtc_common", |
| 186 "//webrtc/base:rtc_base", |
| 187 "//webrtc/base:rtc_base_approved", |
| 188 "//webrtc/base:rtc_task_queue", |
| 189 "//webrtc/media:rtc_data", |
| 190 "//webrtc/media:rtc_media_base_data", |
| 191 "//webrtc/modules/utility:utility", |
| 192 "//webrtc/pc:peerconnection", |
| 193 "//webrtc/system_wrappers:system_wrappers", |
| 194 ] |
| 195 } |
| 196 |
| 197 rtc_static_library("metrics_jni") { |
| 198 sources = [ |
| 199 "src/jni/androidmetrics_jni.cc", |
| 200 ] |
| 201 |
| 202 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
| 203 |
| 204 deps = [ |
| 205 ":base_jni", |
| 206 ":peerconnection_jni", |
| 207 "//webrtc/pc:peerconnection", |
| 208 "//webrtc/system_wrappers", |
| 209 "//webrtc/system_wrappers:field_trial_default", |
| 210 "//webrtc/system_wrappers:metrics_default", |
| 211 ] |
| 212 } |
| 213 |
| 101 rtc_static_library("libjingle_peerconnection_metrics_default_jni") { | 214 rtc_static_library("libjingle_peerconnection_metrics_default_jni") { |
| 102 sources = [ | 215 sources = [ |
| 103 "src/jni/androidmetrics_jni.cc", | 216 "src/jni/androidmetrics_jni.cc", |
| 104 ] | 217 ] |
| 105 | 218 |
| 106 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] | 219 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
| 107 | 220 |
| 108 deps = [ | 221 deps = [ |
| 109 ":libjingle_peerconnection_jni", | 222 ":libjingle_peerconnection_jni", |
| 110 "../../system_wrappers", | |
| 111 "//webrtc/pc:libjingle_peerconnection", | 223 "//webrtc/pc:libjingle_peerconnection", |
| 224 "//webrtc/system_wrappers", |
| 112 "//webrtc/system_wrappers:field_trial_default", | 225 "//webrtc/system_wrappers:field_trial_default", |
| 113 "//webrtc/system_wrappers:metrics_default", | 226 "//webrtc/system_wrappers:metrics_default", |
| 114 ] | 227 ] |
| 115 } | 228 } |
| 116 | 229 |
| 230 # The modular build targets can be used to build WebRTC with different |
| 231 # functionalities. The users can choose either the real implemenation |
| 232 # or the null implementation of the audio/video modules based on their |
| 233 # requirments. |
| 234 # |
| 235 # For example, to build WebRTC with datachannel support only, we would need the |
| 236 # the peerconnection and the null implementation of the video module. |
| 237 # |
| 238 rtc_shared_library("libjingle_peerconnection_datachannelonly_so") { |
| 239 sources = [ |
| 240 "src/jni/jni_onload.cc", |
| 241 ] |
| 242 |
| 243 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] |
| 244 configs += [ "//build/config/android:hide_all_but_jni" ] |
| 245 |
| 246 deps = [ |
| 247 ":base_jni", |
| 248 ":metrics_jni", |
| 249 ":null_video_jni", |
| 250 ":peerconnection_jni", |
| 251 "//webrtc/base:rtc_base", |
| 252 "//webrtc/pc:create_pc_factory_datachannelonly", |
| 253 "//webrtc/pc:peerconnection", |
| 254 ] |
| 255 output_extension = "so" |
| 256 } |
| 257 |
| 117 rtc_shared_library("libjingle_peerconnection_so") { | 258 rtc_shared_library("libjingle_peerconnection_so") { |
| 118 sources = [ | 259 sources = [ |
| 119 "src/jni/jni_onload.cc", | 260 "src/jni/jni_onload.cc", |
| 120 ] | 261 ] |
| 121 | 262 |
| 122 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] | 263 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] |
| 123 configs += [ "//build/config/android:hide_all_but_jni" ] | 264 configs += [ "//build/config/android:hide_all_but_jni" ] |
| 124 | 265 |
| 125 deps = [ | 266 deps = [ |
| 126 ":libjingle_peerconnection_jni", | 267 ":libjingle_peerconnection_jni", |
| 127 ":libjingle_peerconnection_metrics_default_jni", | 268 ":libjingle_peerconnection_metrics_default_jni", |
| 128 "../../base:rtc_base", | 269 "//webrtc/base:rtc_base", |
| 129 "//webrtc/pc:libjingle_peerconnection", | 270 "//webrtc/pc:libjingle_peerconnection", |
| 130 ] | 271 ] |
| 131 output_extension = "so" | 272 output_extension = "so" |
| 132 } | 273 } |
| 133 | 274 |
| 134 dist_jar("libwebrtc") { | 275 dist_jar("libwebrtc") { |
| 135 _target_dir_name = get_label_info(":$target_name", "dir") | 276 _target_dir_name = get_label_info(":$target_name", "dir") |
| 136 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar" | 277 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar" |
| 137 direct_deps_only = true | 278 direct_deps_only = true |
| 138 use_interface_jars = false | 279 use_interface_jars = false |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 "//third_party/android_support_test_runner:runner_java", | 400 "//third_party/android_support_test_runner:runner_java", |
| 260 "//third_party/junit", | 401 "//third_party/junit", |
| 261 "//webrtc/base:base_java", | 402 "//webrtc/base:base_java", |
| 262 "//webrtc/sdk/android:libjingle_peerconnection_java", | 403 "//webrtc/sdk/android:libjingle_peerconnection_java", |
| 263 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java", | 404 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java", |
| 264 ] | 405 ] |
| 265 | 406 |
| 266 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ] | 407 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ] |
| 267 } | 408 } |
| 268 } | 409 } |
| OLD | NEW |