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("base_jni") { |
| 26 sources = [ |
| 27 "src/jni/androidmediacodeccommon.h", |
| 28 "src/jni/classreferenceholder.cc", |
| 29 "src/jni/classreferenceholder.h", |
| 30 "src/jni/jni_helpers.cc", |
| 31 "src/jni/jni_helpers.h", |
| 32 "src/jni/ownedfactoryandthreads.cc", |
| 33 "src/jni/ownedfactoryandthreads.h", |
| 34 ] |
| 35 |
| 36 deps = [ |
| 37 "//webrtc/api:libjingle_peerconnection_api", |
| 38 "//webrtc/base:rtc_base", |
| 39 "//webrtc/base:rtc_base_approved", |
| 40 ] |
| 41 |
| 42 if (is_clang) { |
| 43 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 44 suppressed_configs += [ |
| 45 "//build/config/clang:extra_warnings", |
| 46 "//build/config/clang:find_bad_constructs", |
| 47 ] |
| 48 } |
| 49 } |
| 50 |
| 51 rtc_static_library("audio_jni") { |
| 52 deps = [ |
| 53 ":base_jni", |
| 54 "//webrtc/voice_engine:voice_engine", |
| 55 ] |
| 56 } |
| 57 |
| 58 rtc_static_library("video_jni") { |
26 sources = [ | 59 sources = [ |
27 "src/jni/androidhistogram_jni.cc", | 60 "src/jni/androidhistogram_jni.cc", |
28 "src/jni/androidmediacodeccommon.h", | |
29 "src/jni/androidmediadecoder_jni.cc", | 61 "src/jni/androidmediadecoder_jni.cc", |
30 "src/jni/androidmediadecoder_jni.h", | 62 "src/jni/androidmediadecoder_jni.h", |
31 "src/jni/androidmediaencoder_jni.cc", | 63 "src/jni/androidmediaencoder_jni.cc", |
32 "src/jni/androidmediaencoder_jni.h", | 64 "src/jni/androidmediaencoder_jni.h", |
33 "src/jni/androidnetworkmonitor_jni.cc", | |
34 "src/jni/androidnetworkmonitor_jni.h", | |
35 "src/jni/androidvideotracksource.cc", | 65 "src/jni/androidvideotracksource.cc", |
36 "src/jni/androidvideotracksource.h", | 66 "src/jni/androidvideotracksource.h", |
37 "src/jni/androidvideotracksource_jni.cc", | 67 "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", | 68 "src/jni/native_handle_impl.cc", |
43 "src/jni/native_handle_impl.h", | 69 "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", | 70 "src/jni/surfacetexturehelper_jni.cc", |
48 "src/jni/surfacetexturehelper_jni.h", | 71 "src/jni/surfacetexturehelper_jni.h", |
| 72 "src/jni/video_jni.cc", |
| 73 "src/jni/video_renderer_jni.cc", |
49 ] | 74 ] |
50 | 75 |
51 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] | 76 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
52 | 77 |
53 if (is_clang) { | 78 if (is_clang) { |
54 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 79 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
55 suppressed_configs += [ | 80 suppressed_configs += [ |
56 "//build/config/clang:extra_warnings", | 81 "//build/config/clang:extra_warnings", |
57 "//build/config/clang:find_bad_constructs", | 82 "//build/config/clang:find_bad_constructs", |
58 ] | 83 ] |
59 } | 84 } |
60 | 85 |
61 # TODO(jschuh): Bug 1348: fix this warning. | 86 # TODO(jschuh): Bug 1348: fix this warning. |
62 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | 87 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
63 | 88 |
64 if (is_win) { | 89 if (is_win) { |
65 cflags += [ | 90 cflags += [ |
66 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. | 91 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. |
67 "/wd4389", # signed/unsigned mismatch. | 92 "/wd4389", # signed/unsigned mismatch. |
68 ] | 93 ] |
69 } | 94 } |
70 | 95 |
71 deps = [ | 96 deps = [ |
72 "../..:webrtc_common", | 97 ":base_jni", |
73 "../../api:video_frame_api", | 98 "//webrtc:webrtc_common", |
74 "../../api/video_codecs:video_codecs_api", | 99 "//webrtc/api:libjingle_peerconnection_api", |
75 "../../base:rtc_base", | 100 "//webrtc/api:video_frame_api", |
76 "../../base:rtc_base_approved", | 101 "//webrtc/api/video_codecs:video_codecs_api", |
77 "../../base:rtc_task_queue", | 102 "//webrtc/base:rtc_base", |
78 "../../base:sequenced_task_checker", | 103 "//webrtc/base:rtc_base_approved", |
79 "../../base:weak_ptr", | 104 "//webrtc/base:rtc_task_queue", |
80 "../../common_video:common_video", | 105 "//webrtc/base:sequenced_task_checker", |
81 "../../media:rtc_media", | 106 "//webrtc/base:weak_ptr", |
82 "../../media:rtc_media_base", | 107 "//webrtc/common_video:common_video", |
83 "../../modules/utility:utility", | 108 "//webrtc/media:rtc_audio_video", |
84 "../../modules/video_coding:video_coding_utility", | 109 "//webrtc/media:rtc_media_base_data", |
85 "../../system_wrappers:system_wrappers", | 110 "//webrtc/modules/utility:utility", |
86 "../../voice_engine:voice_engine", | 111 "//webrtc/modules/video_coding:video_coding_utility", |
87 "//webrtc/pc:libjingle_peerconnection", | 112 "//webrtc/system_wrappers:system_wrappers", |
88 ] | 113 ] |
89 | 114 |
90 if (rtc_build_libyuv) { | 115 if (rtc_build_libyuv) { |
91 deps += [ "$rtc_libyuv_dir" ] | 116 deps += [ "$rtc_libyuv_dir" ] |
92 public_deps = [ | 117 public_deps = [ |
93 "$rtc_libyuv_dir", | 118 "$rtc_libyuv_dir", |
94 ] | 119 ] |
95 } else { | 120 } else { |
96 # Need to add a directory normally exported by libyuv. | 121 # Need to add a directory normally exported by libyuv. |
97 include_dirs = [ "$rtc_libyuv_dir/include" ] | 122 include_dirs = [ "$rtc_libyuv_dir/include" ] |
98 } | 123 } |
99 } | 124 } |
100 | 125 |
| 126 rtc_static_library("null_video_jni") { |
| 127 sources = [ |
| 128 "src/jni/null_video_jni.cc", |
| 129 ] |
| 130 |
| 131 deps = [ |
| 132 ":base_jni", |
| 133 "//webrtc/base:rtc_base_approved", |
| 134 ] |
| 135 |
| 136 if (is_clang) { |
| 137 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 138 suppressed_configs += [ |
| 139 "//build/config/clang:extra_warnings", |
| 140 "//build/config/clang:find_bad_constructs", |
| 141 ] |
| 142 } |
| 143 } |
| 144 |
| 145 rtc_static_library("peerconnection_jni") { |
| 146 sources = [ |
| 147 "src/jni/androidnetworkmonitor_jni.cc", |
| 148 "src/jni/androidnetworkmonitor_jni.h", |
| 149 "src/jni/peerconnection_jni.cc", |
| 150 "src/jni/rtcstatscollectorcallbackwrapper.cc", |
| 151 "src/jni/rtcstatscollectorcallbackwrapper.h", |
| 152 ] |
| 153 |
| 154 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
| 155 |
| 156 if (is_clang) { |
| 157 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 158 suppressed_configs += [ |
| 159 "//build/config/clang:extra_warnings", |
| 160 "//build/config/clang:find_bad_constructs", |
| 161 ] |
| 162 } |
| 163 |
| 164 # TODO(jschuh): Bug 1348: fix this warning. |
| 165 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 166 |
| 167 if (is_win) { |
| 168 cflags += [ |
| 169 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. |
| 170 "/wd4389", # signed/unsigned mismatch. |
| 171 ] |
| 172 } |
| 173 |
| 174 deps = [ |
| 175 ":base_jni", |
| 176 "../..:webrtc_common", |
| 177 "//webrtc/base:rtc_base", |
| 178 "//webrtc/base:rtc_base_approved", |
| 179 "//webrtc/base:rtc_task_queue", |
| 180 "//webrtc/media:rtc_data", |
| 181 "//webrtc/media:rtc_media_base_data", |
| 182 "//webrtc/modules/utility:utility", |
| 183 "//webrtc/pc:peerconnection", |
| 184 "//webrtc/system_wrappers:system_wrappers", |
| 185 ] |
| 186 } |
| 187 |
| 188 rtc_static_library("libjingle_peerconnection_jni") { |
| 189 public_deps = [ |
| 190 ":audio_jni", |
| 191 ":base_jni", |
| 192 ":peerconnection_jni", |
| 193 ":video_jni", |
| 194 "//webrtc/pc:create_pc_factory", |
| 195 ] |
| 196 } |
| 197 |
| 198 rtc_static_library("metrics_jni") { |
| 199 sources = [ |
| 200 "src/jni/androidmetrics_jni.cc", |
| 201 ] |
| 202 |
| 203 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
| 204 |
| 205 deps = [ |
| 206 ":base_jni", |
| 207 ":peerconnection_jni", |
| 208 "//webrtc/pc:peerconnection", |
| 209 "//webrtc/system_wrappers", |
| 210 "//webrtc/system_wrappers:field_trial_default", |
| 211 "//webrtc/system_wrappers:metrics_default", |
| 212 ] |
| 213 } |
| 214 |
101 rtc_static_library("libjingle_peerconnection_metrics_default_jni") { | 215 rtc_static_library("libjingle_peerconnection_metrics_default_jni") { |
102 sources = [ | 216 sources = [ |
103 "src/jni/androidmetrics_jni.cc", | 217 "src/jni/androidmetrics_jni.cc", |
104 ] | 218 ] |
105 | 219 |
106 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] | 220 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
107 | 221 |
108 deps = [ | 222 deps = [ |
109 ":libjingle_peerconnection_jni", | 223 ":libjingle_peerconnection_jni", |
110 "../../system_wrappers", | |
111 "//webrtc/pc:libjingle_peerconnection", | 224 "//webrtc/pc:libjingle_peerconnection", |
| 225 "//webrtc/system_wrappers", |
112 "//webrtc/system_wrappers:field_trial_default", | 226 "//webrtc/system_wrappers:field_trial_default", |
113 "//webrtc/system_wrappers:metrics_default", | 227 "//webrtc/system_wrappers:metrics_default", |
114 ] | 228 ] |
115 } | 229 } |
116 | 230 |
| 231 # This target implements the CreatePeerConnectionFactory methods to build WebRTC |
| 232 # with datachannel only support. |
| 233 rtc_static_library("create_pc_factory_datachannelonly") { |
| 234 sources = [ |
| 235 "src/jni/createpeerconnectionfactory_datachannelonly.cc", |
| 236 ] |
| 237 |
| 238 deps = [ |
| 239 "//webrtc/api:audio_mixer_api", |
| 240 "//webrtc/api:libjingle_peerconnection_api", |
| 241 "//webrtc/base:rtc_base", |
| 242 "//webrtc/base:rtc_base_approved", |
| 243 "//webrtc/call:call_interfaces", |
| 244 "//webrtc/logging:rtc_event_log_api", |
| 245 ] |
| 246 |
| 247 if (!build_with_chromium && is_clang) { |
| 248 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 249 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 250 } |
| 251 } |
| 252 |
| 253 # The modular build targets can be used to build WebRTC with different |
| 254 # functionalities. The users can choose either the real implemenation |
| 255 # or the null implementation of the audio/video modules based on their |
| 256 # requirments. |
| 257 # |
| 258 # For example, to build WebRTC with datachannel support only, we would need the |
| 259 # the peerconnection and the null implementation of the video module. |
| 260 # |
| 261 rtc_shared_library("libjingle_peerconnection_datachannelonly_so") { |
| 262 sources = [ |
| 263 "src/jni/jni_onload.cc", |
| 264 ] |
| 265 |
| 266 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] |
| 267 configs += [ "//build/config/android:hide_all_but_jni" ] |
| 268 |
| 269 deps = [ |
| 270 ":base_jni", |
| 271 ":create_pc_factory_datachannelonly", |
| 272 ":metrics_jni", |
| 273 ":null_video_jni", |
| 274 ":peerconnection_jni", |
| 275 "//webrtc/base:rtc_base", |
| 276 "//webrtc/base:rtc_base_approved", |
| 277 "//webrtc/pc:peerconnection", |
| 278 ] |
| 279 output_extension = "so" |
| 280 } |
| 281 |
117 rtc_shared_library("libjingle_peerconnection_so") { | 282 rtc_shared_library("libjingle_peerconnection_so") { |
118 sources = [ | 283 sources = [ |
119 "src/jni/jni_onload.cc", | 284 "src/jni/jni_onload.cc", |
120 ] | 285 ] |
121 | 286 |
122 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] | 287 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] |
123 configs += [ "//build/config/android:hide_all_but_jni" ] | 288 configs += [ "//build/config/android:hide_all_but_jni" ] |
124 | 289 |
125 deps = [ | 290 deps = [ |
126 ":libjingle_peerconnection_jni", | 291 ":libjingle_peerconnection_jni", |
127 ":libjingle_peerconnection_metrics_default_jni", | 292 ":libjingle_peerconnection_metrics_default_jni", |
128 "../../base:rtc_base", | 293 "//webrtc/base:rtc_base", |
129 "//webrtc/pc:libjingle_peerconnection", | 294 "//webrtc/pc:libjingle_peerconnection", |
130 ] | 295 ] |
131 output_extension = "so" | 296 output_extension = "so" |
132 } | 297 } |
133 | 298 |
134 dist_jar("libwebrtc") { | 299 dist_jar("libwebrtc") { |
135 _target_dir_name = get_label_info(":$target_name", "dir") | 300 _target_dir_name = get_label_info(":$target_name", "dir") |
136 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar" | 301 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar" |
137 direct_deps_only = true | 302 direct_deps_only = true |
138 use_interface_jars = false | 303 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", | 424 "//third_party/android_support_test_runner:runner_java", |
260 "//third_party/junit", | 425 "//third_party/junit", |
261 "//webrtc/base:base_java", | 426 "//webrtc/base:base_java", |
262 "//webrtc/sdk/android:libjingle_peerconnection_java", | 427 "//webrtc/sdk/android:libjingle_peerconnection_java", |
263 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java", | 428 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java", |
264 ] | 429 ] |
265 | 430 |
266 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ] | 431 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ] |
267 } | 432 } |
268 } | 433 } |
OLD | NEW |