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