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