kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 1 | # Copyright (c) 2014 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 | import("//build/config/crypto.gni") |
henrike@webrtc.org | fb1eb43 | 2014-08-15 14:44:13 +0000 | [diff] [blame] | 10 | import("//build/config/ui.gni") |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 11 | import("../webrtc.gni") |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 12 | |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 13 | if (is_android) { |
| 14 | import("//build/config/android/config.gni") |
| 15 | import("//build/config/android/rules.gni") |
| 16 | } |
ehmaldonado | 2334b70 | 2016-10-07 02:47:38 -0700 | [diff] [blame] | 17 | if (is_win) { |
ehmaldonado | 5c63989 | 2016-10-17 12:28:44 -0700 | [diff] [blame] | 18 | import("//build/config/clang/clang.gni") |
ehmaldonado | 2334b70 | 2016-10-07 02:47:38 -0700 | [diff] [blame] | 19 | } |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 20 | |
kjellander | 6ceab08 | 2016-10-28 05:44:03 -0700 | [diff] [blame] | 21 | group("base") { |
| 22 | public_deps = [ |
| 23 | ":rtc_base", |
| 24 | ":rtc_base_approved", |
| 25 | ":rtc_task_queue", |
| 26 | ] |
| 27 | if (is_android) { |
| 28 | public_deps += [ ":base_java" ] |
| 29 | } |
| 30 | } |
| 31 | |
kjellander | 84ba8b6 | 2016-04-24 23:03:07 -0700 | [diff] [blame] | 32 | config("rtc_base_approved_all_dependent_config") { |
| 33 | if (is_mac && !build_with_chromium) { |
| 34 | libs = [ "Foundation.framework" ] # needed for logging_mac.mm |
| 35 | } |
| 36 | } |
| 37 | |
kjellander@webrtc.org | c429b82 | 2015-01-21 20:22:33 +0000 | [diff] [blame] | 38 | config("rtc_base_chromium_config") { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 39 | defines = [ "NO_MAIN_THREAD_WRAPPING" ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 40 | } |
| 41 | |
kjellander | b1f1406 | 2016-04-25 00:01:36 -0700 | [diff] [blame] | 42 | config("rtc_base_all_dependent_config") { |
| 43 | if (is_ios) { |
| 44 | libs = [ |
| 45 | "CFNetwork.framework", |
Zeke Chin | 2d3b7e2 | 2015-07-14 12:55:44 -0700 | [diff] [blame] | 46 | |
kjellander | b1f1406 | 2016-04-25 00:01:36 -0700 | [diff] [blame] | 47 | #"Foundation.framework", # Already in //build/config:default_libs. |
| 48 | "Security.framework", |
| 49 | "SystemConfiguration.framework", |
kjellander | 3bcedd3 | 2016-06-08 01:14:15 -0700 | [diff] [blame] | 50 | "UIKit.framework", |
kjellander | b1f1406 | 2016-04-25 00:01:36 -0700 | [diff] [blame] | 51 | ] |
| 52 | } |
| 53 | if (is_mac) { |
| 54 | libs = [ |
| 55 | "Cocoa.framework", |
| 56 | "Foundation.framework", |
| 57 | "IOKit.framework", |
| 58 | "Security.framework", |
| 59 | "SystemConfiguration.framework", |
| 60 | ] |
kjellander | b1f1406 | 2016-04-25 00:01:36 -0700 | [diff] [blame] | 61 | } |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 62 | } |
| 63 | |
kjellander@webrtc.org | 4a25199 | 2014-08-18 17:56:28 +0000 | [diff] [blame] | 64 | if (is_linux && !build_with_chromium) { |
| 65 | # Provides the same functionality as the //crypto:platform target, which |
| 66 | # WebRTC cannot use as we don't sync src/crypto from Chromium. |
| 67 | group("linux_system_ssl") { |
svaldez | 7f7a819 | 2016-04-18 11:13:11 -0700 | [diff] [blame] | 68 | deps = [ |
| 69 | "//third_party/boringssl", |
| 70 | ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 71 | } |
| 72 | } |
| 73 | |
kjellander | ec5c906 | 2016-08-19 01:07:30 -0700 | [diff] [blame] | 74 | if (!rtc_build_ssl) { |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 75 | config("external_ssl_library") { |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 76 | assert(rtc_ssl_root != "", |
| 77 | "You must specify rtc_ssl_root when rtc_build_ssl==0.") |
| 78 | include_dirs = [ rtc_ssl_root ] |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 79 | } |
| 80 | } |
kjellander@webrtc.org | 4a25199 | 2014-08-18 17:56:28 +0000 | [diff] [blame] | 81 | |
mbonadei | 7c2c843 | 2017-04-07 00:59:12 -0700 | [diff] [blame] | 82 | source_set("protobuf_utils") { |
| 83 | sources = [ |
| 84 | "protobuf_utils.h", |
| 85 | ] |
| 86 | if (rtc_enable_protobuf) { |
| 87 | public_deps = [ |
| 88 | "//third_party/protobuf:protobuf_lite", |
| 89 | ] |
| 90 | } |
| 91 | } |
| 92 | |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 93 | # The subset of rtc_base approved for use outside of libjingle. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 94 | rtc_static_library("rtc_base_approved") { |
tommi | c06b133 | 2016-05-14 11:31:40 -0700 | [diff] [blame] | 95 | defines = [] |
aleloi | 16f55a1 | 2016-08-23 08:08:23 -0700 | [diff] [blame] | 96 | libs = [] |
Peter Boström | 11e0229 | 2015-11-25 21:36:14 +0100 | [diff] [blame] | 97 | deps = [] |
kjellander | 84ba8b6 | 2016-04-24 23:03:07 -0700 | [diff] [blame] | 98 | all_dependent_configs = [ ":rtc_base_approved_all_dependent_config" ] |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 99 | |
| 100 | sources = [ |
Karl Wiberg | e2a83ee | 2015-10-26 19:51:29 +0100 | [diff] [blame] | 101 | "array_view.h", |
maxmorin | ec62374 | 2016-09-15 05:11:55 -0700 | [diff] [blame] | 102 | "arraysize.h", |
Peter Boström | ff019b0 | 2015-04-30 14:16:07 +0200 | [diff] [blame] | 103 | "atomicops.h", |
philipel | a9a1ac2 | 2016-10-28 14:23:14 +0200 | [diff] [blame] | 104 | "base64.cc", |
| 105 | "base64.h", |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 106 | "basictypes.h", |
Tommi | cc4fdde | 2016-04-22 19:34:59 +0200 | [diff] [blame] | 107 | "bind.h", |
Noah Richards | 915590e | 2015-04-22 15:43:08 -0700 | [diff] [blame] | 108 | "bitbuffer.cc", |
| 109 | "bitbuffer.h", |
Karl Wiberg | 9478437 | 2015-04-20 14:03:07 +0200 | [diff] [blame] | 110 | "buffer.h", |
Joachim Bauch | 6f2ef74 | 2015-05-21 17:52:01 +0200 | [diff] [blame] | 111 | "bufferqueue.cc", |
| 112 | "bufferqueue.h", |
Noah Richards | 915590e | 2015-04-22 15:43:08 -0700 | [diff] [blame] | 113 | "bytebuffer.cc", |
| 114 | "bytebuffer.h", |
| 115 | "byteorder.h", |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 116 | "checks.cc", |
| 117 | "checks.h", |
Peter Boström | fd5dae3 | 2015-11-26 12:54:24 +0100 | [diff] [blame] | 118 | "constructormagic.h", |
tommi | ebfbab5 | 2016-03-19 11:36:18 -0700 | [diff] [blame] | 119 | "copyonwritebuffer.cc", |
| 120 | "copyonwritebuffer.h", |
Tommi | 494f209 | 2015-04-27 17:39:23 +0200 | [diff] [blame] | 121 | "criticalsection.cc", |
| 122 | "criticalsection.h", |
kwiberg | 45fd9fe | 2015-12-16 01:09:16 -0800 | [diff] [blame] | 123 | "deprecation.h", |
tommi@webrtc.org | 4c0fd96 | 2015-02-09 10:23:27 +0000 | [diff] [blame] | 124 | "event.cc", |
| 125 | "event.h", |
tommi@webrtc.org | 7c64ed2 | 2015-03-17 14:25:37 +0000 | [diff] [blame] | 126 | "event_tracer.cc", |
| 127 | "event_tracer.h", |
Viktor Palmkvist | 4ec6a0c | 2016-09-02 13:38:32 +0200 | [diff] [blame] | 128 | "file.cc", |
| 129 | "file.h", |
zijiehe | dd87d58 | 2016-12-06 15:04:02 -0800 | [diff] [blame] | 130 | "flags.cc", |
| 131 | "flags.h", |
ivoc | 4805231 | 2016-08-25 04:43:45 -0700 | [diff] [blame] | 132 | "format_macros.h", |
kwiberg | 24c7c12 | 2016-09-28 11:57:10 -0700 | [diff] [blame] | 133 | "function_view.h", |
kwiberg | 77eab70 | 2016-09-28 17:42:01 -0700 | [diff] [blame] | 134 | "ignore_wundef.h", |
Taylor Brandstetter | 5d97a9a | 2016-06-10 14:17:27 -0700 | [diff] [blame] | 135 | "location.cc", |
| 136 | "location.h", |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 137 | "md5.cc", |
| 138 | "md5.h", |
kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame] | 139 | "md5digest.cc", |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 140 | "md5digest.h", |
kjellander | a8a7ef6 | 2016-04-05 08:13:31 -0700 | [diff] [blame] | 141 | "mod_ops.h", |
skvlad | 98bb664 | 2016-04-07 15:36:45 -0700 | [diff] [blame] | 142 | "onetimeevent.h", |
kwiberg | 2b11fd2 | 2016-09-09 03:35:24 -0700 | [diff] [blame] | 143 | "optional.cc", |
Karl Wiberg | be57983 | 2015-11-10 22:34:18 +0100 | [diff] [blame] | 144 | "optional.h", |
zijiehe | dd87d58 | 2016-12-06 15:04:02 -0800 | [diff] [blame] | 145 | "pathutils.cc", |
| 146 | "pathutils.h", |
xians@webrtc.org | e46bc77 | 2014-10-10 08:36:56 +0000 | [diff] [blame] | 147 | "platform_file.cc", |
| 148 | "platform_file.h", |
Tommi | bebc690 | 2015-05-18 09:51:42 +0200 | [diff] [blame] | 149 | "platform_thread.cc", |
| 150 | "platform_thread.h", |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame] | 151 | "platform_thread_types.h", |
zstein | f42cc9d | 2017-03-27 16:17:19 -0700 | [diff] [blame] | 152 | "ptr_util.h", |
Peter Boström | 02bafc6 | 2016-07-01 12:45:15 +0200 | [diff] [blame] | 153 | "race_checker.cc", |
| 154 | "race_checker.h", |
terelius | 84e78f9 | 2015-12-10 01:50:55 -0800 | [diff] [blame] | 155 | "random.cc", |
| 156 | "random.h", |
sprang | cd349d9 | 2016-07-13 09:11:28 -0700 | [diff] [blame] | 157 | "rate_limiter.cc", |
| 158 | "rate_limiter.h", |
tkchin | f75d008 | 2016-02-23 22:49:42 -0800 | [diff] [blame] | 159 | "rate_statistics.cc", |
| 160 | "rate_statistics.h", |
kjellander | a8a7ef6 | 2016-04-05 08:13:31 -0700 | [diff] [blame] | 161 | "ratetracker.cc", |
| 162 | "ratetracker.h", |
tommi | 04af839 | 2016-02-14 08:11:10 -0800 | [diff] [blame] | 163 | "refcount.h", |
perkj | 0489e49 | 2016-10-20 00:24:01 -0700 | [diff] [blame] | 164 | "refcountedobject.h", |
kwiberg | 8a44e1d | 2016-11-01 12:04:26 -0700 | [diff] [blame] | 165 | "safe_compare.h", |
Tommi | d44c077 | 2016-03-11 17:12:32 -0800 | [diff] [blame] | 166 | "safe_conversions.h", |
| 167 | "safe_conversions_impl.h", |
kwiberg | ac554ee | 2016-09-02 00:39:33 -0700 | [diff] [blame] | 168 | "sanitizer.h", |
tommi | 04af839 | 2016-02-14 08:11:10 -0800 | [diff] [blame] | 169 | "scoped_ref_ptr.h", |
ossu | a280f7c | 2017-04-06 02:02:15 -0700 | [diff] [blame] | 170 | "string_to_number.cc", |
| 171 | "string_to_number.h", |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 172 | "stringencode.cc", |
| 173 | "stringencode.h", |
| 174 | "stringutils.cc", |
| 175 | "stringutils.h", |
terelius | 85fa7d5 | 2016-03-24 01:51:52 -0700 | [diff] [blame] | 176 | "swap_queue.h", |
kwiberg@webrtc.org | af9d56f | 2015-01-13 20:32:04 +0000 | [diff] [blame] | 177 | "template_util.h", |
pbos@webrtc.org | 38344ed | 2014-09-24 06:05:00 +0000 | [diff] [blame] | 178 | "thread_annotations.h", |
tommi@webrtc.org | 04cd466 | 2015-01-26 15:27:29 +0000 | [diff] [blame] | 179 | "thread_checker.h", |
| 180 | "thread_checker_impl.cc", |
| 181 | "thread_checker_impl.h", |
nisse | 191b359 | 2016-06-22 08:36:53 -0700 | [diff] [blame] | 182 | "timestampaligner.cc", |
| 183 | "timestampaligner.h", |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 184 | "timeutils.cc", |
| 185 | "timeutils.h", |
tommi@webrtc.org | 7c64ed2 | 2015-03-17 14:25:37 +0000 | [diff] [blame] | 186 | "trace_event.h", |
kwiberg | d313403 | 2016-09-05 07:46:20 -0700 | [diff] [blame] | 187 | "type_traits.h", |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 188 | ] |
Noah Richards | 915590e | 2015-04-22 15:43:08 -0700 | [diff] [blame] | 189 | |
aleloi | 16f55a1 | 2016-08-23 08:08:23 -0700 | [diff] [blame] | 190 | if (is_android) { |
| 191 | libs += [ "log" ] |
| 192 | } |
| 193 | |
Viktor Palmkvist | 4ec6a0c | 2016-09-02 13:38:32 +0200 | [diff] [blame] | 194 | if (is_posix) { |
| 195 | sources += [ "file_posix.cc" ] |
| 196 | } |
| 197 | |
| 198 | if (is_win) { |
| 199 | sources += [ "file_win.cc" ] |
| 200 | } |
| 201 | |
Peter Boström | 11e0229 | 2015-11-25 21:36:14 +0100 | [diff] [blame] | 202 | if (build_with_chromium) { |
| 203 | # Dependency on chromium's logging (in //base). |
| 204 | deps += [ "//base:base" ] |
| 205 | sources += [ |
| 206 | "../../webrtc_overrides/webrtc/base/logging.cc", |
| 207 | "../../webrtc_overrides/webrtc/base/logging.h", |
| 208 | ] |
Peter Boström | 11e0229 | 2015-11-25 21:36:14 +0100 | [diff] [blame] | 209 | } else { |
Noah Richards | 915590e | 2015-04-22 15:43:08 -0700 | [diff] [blame] | 210 | sources += [ |
Tommi | 23edcff | 2015-05-25 10:45:43 +0200 | [diff] [blame] | 211 | "logging.cc", |
| 212 | "logging.h", |
Tommi | 09ca02e | 2016-04-24 17:32:48 +0200 | [diff] [blame] | 213 | "logging_mac.mm", |
Noah Richards | 915590e | 2015-04-22 15:43:08 -0700 | [diff] [blame] | 214 | ] |
| 215 | } |
ehmaldonado | 2334b70 | 2016-10-07 02:47:38 -0700 | [diff] [blame] | 216 | if (is_component_build && is_win) { |
| 217 | # Copy the VS runtime DLLs into the isolate so that they don't have to be |
| 218 | # preinstalled on the target machine. The debug runtimes have a "d" at |
| 219 | # the end. |
| 220 | # This is a copy of https://codereview.chromium.org/1783973002. |
| 221 | # TODO(ehmaldonado): We'd like Chromium to make this changes easier to use, |
| 222 | # so we don't have to copy their changes and risk breakages. |
| 223 | # See http://crbug.com/653569 |
| 224 | if (is_debug) { |
| 225 | vcrt_suffix = "d" |
| 226 | } else { |
| 227 | vcrt_suffix = "" |
| 228 | } |
| 229 | |
| 230 | # These runtime files are copied to the output directory by the |
| 231 | # vs_toolchain script that runs as part of toolchain configuration. |
ehmaldonado | 809f977 | 2016-11-03 11:26:34 -0700 | [diff] [blame] | 232 | data = [ |
| 233 | "$root_out_dir/msvcp140${vcrt_suffix}.dll", |
| 234 | "$root_out_dir/vccorlib140${vcrt_suffix}.dll", |
| 235 | "$root_out_dir/vcruntime140${vcrt_suffix}.dll", |
ehmaldonado | 2334b70 | 2016-10-07 02:47:38 -0700 | [diff] [blame] | 236 | |
ehmaldonado | 809f977 | 2016-11-03 11:26:34 -0700 | [diff] [blame] | 237 | # Universal Windows 10 CRT files |
| 238 | "$root_out_dir/api-ms-win-core-console-l1-1-0.dll", |
| 239 | "$root_out_dir/api-ms-win-core-datetime-l1-1-0.dll", |
| 240 | "$root_out_dir/api-ms-win-core-debug-l1-1-0.dll", |
| 241 | "$root_out_dir/api-ms-win-core-errorhandling-l1-1-0.dll", |
| 242 | "$root_out_dir/api-ms-win-core-file-l1-1-0.dll", |
| 243 | "$root_out_dir/api-ms-win-core-file-l1-2-0.dll", |
| 244 | "$root_out_dir/api-ms-win-core-file-l2-1-0.dll", |
| 245 | "$root_out_dir/api-ms-win-core-handle-l1-1-0.dll", |
| 246 | "$root_out_dir/api-ms-win-core-heap-l1-1-0.dll", |
| 247 | "$root_out_dir/api-ms-win-core-interlocked-l1-1-0.dll", |
| 248 | "$root_out_dir/api-ms-win-core-libraryloader-l1-1-0.dll", |
| 249 | "$root_out_dir/api-ms-win-core-localization-l1-2-0.dll", |
| 250 | "$root_out_dir/api-ms-win-core-memory-l1-1-0.dll", |
| 251 | "$root_out_dir/api-ms-win-core-namedpipe-l1-1-0.dll", |
| 252 | "$root_out_dir/api-ms-win-core-processenvironment-l1-1-0.dll", |
| 253 | "$root_out_dir/api-ms-win-core-processthreads-l1-1-0.dll", |
| 254 | "$root_out_dir/api-ms-win-core-processthreads-l1-1-1.dll", |
| 255 | "$root_out_dir/api-ms-win-core-profile-l1-1-0.dll", |
| 256 | "$root_out_dir/api-ms-win-core-rtlsupport-l1-1-0.dll", |
| 257 | "$root_out_dir/api-ms-win-core-string-l1-1-0.dll", |
| 258 | "$root_out_dir/api-ms-win-core-synch-l1-1-0.dll", |
| 259 | "$root_out_dir/api-ms-win-core-synch-l1-2-0.dll", |
| 260 | "$root_out_dir/api-ms-win-core-sysinfo-l1-1-0.dll", |
| 261 | "$root_out_dir/api-ms-win-core-timezone-l1-1-0.dll", |
| 262 | "$root_out_dir/api-ms-win-core-util-l1-1-0.dll", |
| 263 | "$root_out_dir/api-ms-win-crt-conio-l1-1-0.dll", |
| 264 | "$root_out_dir/api-ms-win-crt-convert-l1-1-0.dll", |
| 265 | "$root_out_dir/api-ms-win-crt-environment-l1-1-0.dll", |
| 266 | "$root_out_dir/api-ms-win-crt-filesystem-l1-1-0.dll", |
| 267 | "$root_out_dir/api-ms-win-crt-heap-l1-1-0.dll", |
| 268 | "$root_out_dir/api-ms-win-crt-locale-l1-1-0.dll", |
| 269 | "$root_out_dir/api-ms-win-crt-math-l1-1-0.dll", |
| 270 | "$root_out_dir/api-ms-win-crt-multibyte-l1-1-0.dll", |
| 271 | "$root_out_dir/api-ms-win-crt-private-l1-1-0.dll", |
| 272 | "$root_out_dir/api-ms-win-crt-process-l1-1-0.dll", |
| 273 | "$root_out_dir/api-ms-win-crt-runtime-l1-1-0.dll", |
| 274 | "$root_out_dir/api-ms-win-crt-stdio-l1-1-0.dll", |
| 275 | "$root_out_dir/api-ms-win-crt-string-l1-1-0.dll", |
| 276 | "$root_out_dir/api-ms-win-crt-time-l1-1-0.dll", |
| 277 | "$root_out_dir/api-ms-win-crt-utility-l1-1-0.dll", |
| 278 | "$root_out_dir/ucrtbase${vcrt_suffix}.dll", |
| 279 | ] |
ehmaldonado | 2334b70 | 2016-10-07 02:47:38 -0700 | [diff] [blame] | 280 | if (is_asan) { |
| 281 | if (current_cpu == "x64") { |
| 282 | data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-x86_64.dll" ] |
| 283 | } else { |
| 284 | data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-i386.dll" ] |
| 285 | } |
| 286 | } |
| 287 | } |
jbauch | 5533bd3 | 2017-03-31 01:42:09 -0700 | [diff] [blame] | 288 | if (is_nacl) { |
| 289 | deps += [ "//native_client_sdk/src/libraries/nacl_io" ] |
| 290 | } |
tommi | 09c60da | 2016-05-24 11:40:35 -0700 | [diff] [blame] | 291 | } |
| 292 | |
Per | 33b9c8f | 2016-07-15 08:25:42 +0200 | [diff] [blame] | 293 | config("enable_libevent_config") { |
| 294 | defines = [ "WEBRTC_BUILD_LIBEVENT" ] |
| 295 | } |
| 296 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 297 | rtc_static_library("rtc_task_queue") { |
kjellander | bac0412 | 2016-06-02 02:18:48 -0700 | [diff] [blame] | 298 | public_deps = [ |
| 299 | ":rtc_base_approved", |
| 300 | ] |
tommi | 09c60da | 2016-05-24 11:40:35 -0700 | [diff] [blame] | 301 | |
| 302 | sources = [ |
perkj | 9c16fe8 | 2016-07-12 15:04:07 -0700 | [diff] [blame] | 303 | "sequenced_task_checker.h", |
| 304 | "sequenced_task_checker_impl.cc", |
| 305 | "sequenced_task_checker_impl.h", |
perkj | 8ff860a | 2016-10-03 00:30:04 -0700 | [diff] [blame] | 306 | "weak_ptr.cc", |
| 307 | "weak_ptr.h", |
tommi | 09c60da | 2016-05-24 11:40:35 -0700 | [diff] [blame] | 308 | ] |
tommi | c06b133 | 2016-05-14 11:31:40 -0700 | [diff] [blame] | 309 | |
perkj | 84bd5c7 | 2016-08-30 23:01:06 -0700 | [diff] [blame] | 310 | if (build_with_chromium) { |
phoglund | ff27439 | 2016-05-17 03:44:28 -0700 | [diff] [blame] | 311 | sources += [ |
perkj | 84bd5c7 | 2016-08-30 23:01:06 -0700 | [diff] [blame] | 312 | "../../webrtc_overrides/webrtc/base/task_queue.cc", |
| 313 | "../../webrtc_overrides/webrtc/base/task_queue.h", |
phoglund | ff27439 | 2016-05-17 03:44:28 -0700 | [diff] [blame] | 314 | ] |
| 315 | } else { |
perkj | 84bd5c7 | 2016-08-30 23:01:06 -0700 | [diff] [blame] | 316 | sources += [ |
| 317 | "task_queue.h", |
| 318 | "task_queue_posix.h", |
| 319 | ] |
| 320 | if (rtc_build_libevent) { |
| 321 | deps = [ |
| 322 | "//base/third_party/libevent", |
phoglund | ff27439 | 2016-05-17 03:44:28 -0700 | [diff] [blame] | 323 | ] |
| 324 | } |
perkj | 84bd5c7 | 2016-08-30 23:01:06 -0700 | [diff] [blame] | 325 | |
| 326 | if (rtc_enable_libevent) { |
| 327 | sources += [ |
| 328 | "task_queue_libevent.cc", |
| 329 | "task_queue_posix.cc", |
| 330 | ] |
| 331 | all_dependent_configs = [ ":enable_libevent_config" ] |
| 332 | } else { |
| 333 | if (is_mac || is_ios) { |
| 334 | sources += [ |
| 335 | "task_queue_gcd.cc", |
| 336 | "task_queue_posix.cc", |
| 337 | ] |
| 338 | } |
| 339 | if (is_win) { |
| 340 | sources += [ "task_queue_win.cc" ] |
| 341 | } |
phoglund | ff27439 | 2016-05-17 03:44:28 -0700 | [diff] [blame] | 342 | } |
tommi | c06b133 | 2016-05-14 11:31:40 -0700 | [diff] [blame] | 343 | } |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 344 | } |
| 345 | |
terelius | bc5d921 | 2017-01-13 09:14:33 -0800 | [diff] [blame] | 346 | rtc_static_library("rtc_numerics") { |
minyue | 69b627d | 2016-11-24 11:01:09 -0800 | [diff] [blame] | 347 | sources = [ |
terelius | bc5d921 | 2017-01-13 09:14:33 -0800 | [diff] [blame] | 348 | "numerics/exp_filter.cc", |
| 349 | "numerics/exp_filter.h", |
| 350 | "numerics/percentile_filter.h", |
terelius | cb861e0 | 2016-11-30 06:51:57 -0800 | [diff] [blame] | 351 | ] |
| 352 | deps = [ |
| 353 | ":rtc_base_approved", |
minyue | 69b627d | 2016-11-24 11:01:09 -0800 | [diff] [blame] | 354 | ] |
| 355 | } |
| 356 | |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 357 | config("rtc_base_warnings_config") { |
| 358 | if (is_win && is_clang) { |
| 359 | cflags = [ |
| 360 | # Disable warnings failing when compiling with Clang on Windows. |
| 361 | # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 |
| 362 | "-Wno-sign-compare", |
| 363 | "-Wno-missing-braces", |
| 364 | ] |
| 365 | } |
| 366 | } |
| 367 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 368 | rtc_static_library("rtc_base") { |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 369 | cflags = [] |
| 370 | cflags_cc = [] |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 371 | libs = [] |
kjellander | a101e56 | 2016-10-27 02:34:31 -0700 | [diff] [blame] | 372 | defines = [] |
kjellander | a8a7ef6 | 2016-04-05 08:13:31 -0700 | [diff] [blame] | 373 | deps = [ |
| 374 | "..:webrtc_common", |
| 375 | ] |
Tommi | d44c077 | 2016-03-11 17:12:32 -0800 | [diff] [blame] | 376 | public_deps = [ |
| 377 | ":rtc_base_approved", |
| 378 | ] |
deadbeef | 1b54a5f | 2017-01-23 19:39:57 -0800 | [diff] [blame] | 379 | public_configs = [] |
deadbeef | f33491e | 2017-01-20 17:01:45 -0800 | [diff] [blame] | 380 | |
kjellander | b1f1406 | 2016-04-25 00:01:36 -0700 | [diff] [blame] | 381 | all_dependent_configs = [ ":rtc_base_all_dependent_config" ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 382 | |
| 383 | sources = [ |
kthelgason | d547224 | 2016-09-09 03:19:48 -0700 | [diff] [blame] | 384 | "applefilesystem.mm", |
Guo-wei Shieh | ecb9a70c | 2015-06-21 23:37:01 -0700 | [diff] [blame] | 385 | "asyncinvoker-inl.h", |
| 386 | "asyncinvoker.cc", |
| 387 | "asyncinvoker.h", |
kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame] | 388 | "asyncpacketsocket.cc", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 389 | "asyncpacketsocket.h", |
kwiberg@webrtc.org | dad85aa | 2015-03-10 00:59:54 +0000 | [diff] [blame] | 390 | "asyncresolverinterface.cc", |
| 391 | "asyncresolverinterface.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 392 | "asyncsocket.cc", |
| 393 | "asyncsocket.h", |
| 394 | "asynctcpsocket.cc", |
| 395 | "asynctcpsocket.h", |
| 396 | "asyncudpsocket.cc", |
| 397 | "asyncudpsocket.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 398 | "crc32.cc", |
| 399 | "crc32.h", |
deadbeef | f137e97 | 2017-03-23 15:45:49 -0700 | [diff] [blame] | 400 | "cryptstring.cc", |
| 401 | "cryptstring.h", |
tkchin | 9341191 | 2015-07-22 12:12:17 -0700 | [diff] [blame] | 402 | "filerotatingstream.cc", |
| 403 | "filerotatingstream.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 404 | "fileutils.cc", |
| 405 | "fileutils.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 406 | "gunit_prod.h", |
| 407 | "helpers.cc", |
| 408 | "helpers.h", |
deadbeef | f137e97 | 2017-03-23 15:45:49 -0700 | [diff] [blame] | 409 | "httpbase.cc", |
| 410 | "httpbase.h", |
| 411 | "httpcommon-inl.h", |
| 412 | "httpcommon.cc", |
| 413 | "httpcommon.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 414 | "ipaddress.cc", |
| 415 | "ipaddress.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 416 | "messagedigest.cc", |
| 417 | "messagedigest.h", |
| 418 | "messagehandler.cc", |
| 419 | "messagehandler.h", |
| 420 | "messagequeue.cc", |
| 421 | "messagequeue.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 422 | "nethelpers.cc", |
| 423 | "nethelpers.h", |
| 424 | "network.cc", |
| 425 | "network.h", |
honghaiz | 023f3ef | 2015-10-19 09:39:32 -0700 | [diff] [blame] | 426 | "networkmonitor.cc", |
| 427 | "networkmonitor.h", |
danilchap | bebf54c | 2016-04-28 01:32:48 -0700 | [diff] [blame] | 428 | "nullsocketserver.cc", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 429 | "nullsocketserver.h", |
svaldez | 7f7a819 | 2016-04-18 11:13:11 -0700 | [diff] [blame] | 430 | "openssl.h", |
| 431 | "openssladapter.cc", |
| 432 | "openssladapter.h", |
| 433 | "openssldigest.cc", |
| 434 | "openssldigest.h", |
| 435 | "opensslidentity.cc", |
| 436 | "opensslidentity.h", |
| 437 | "opensslstreamadapter.cc", |
| 438 | "opensslstreamadapter.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 439 | "physicalsocketserver.cc", |
| 440 | "physicalsocketserver.h", |
deadbeef | f137e97 | 2017-03-23 15:45:49 -0700 | [diff] [blame] | 441 | "proxyinfo.cc", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 442 | "proxyinfo.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 443 | "ratelimiter.cc", |
| 444 | "ratelimiter.h", |
Henrik Boström | 41b3a38 | 2015-08-20 12:15:54 +0200 | [diff] [blame] | 445 | "rtccertificate.cc", |
| 446 | "rtccertificate.h", |
Henrik Boström | da3a1da | 2016-04-15 17:55:21 +0200 | [diff] [blame] | 447 | "rtccertificategenerator.cc", |
| 448 | "rtccertificategenerator.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 449 | "sha1.cc", |
| 450 | "sha1.h", |
kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame] | 451 | "sha1digest.cc", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 452 | "sha1digest.h", |
jbauch | a18f638 | 2016-02-21 01:56:16 -0800 | [diff] [blame] | 453 | "sharedexclusivelock.cc", |
| 454 | "sharedexclusivelock.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 455 | "signalthread.cc", |
| 456 | "signalthread.h", |
kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame] | 457 | "sigslot.cc", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 458 | "sigslot.h", |
| 459 | "sigslotrepeater.h", |
| 460 | "socket.h", |
| 461 | "socketadapters.cc", |
| 462 | "socketadapters.h", |
| 463 | "socketaddress.cc", |
| 464 | "socketaddress.h", |
| 465 | "socketaddresspair.cc", |
| 466 | "socketaddresspair.h", |
| 467 | "socketfactory.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 468 | "socketserver.h", |
| 469 | "socketstream.cc", |
| 470 | "socketstream.h", |
| 471 | "ssladapter.cc", |
| 472 | "ssladapter.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 473 | "sslfingerprint.cc", |
| 474 | "sslfingerprint.h", |
| 475 | "sslidentity.cc", |
| 476 | "sslidentity.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 477 | "sslstreamadapter.cc", |
| 478 | "sslstreamadapter.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 479 | "stream.cc", |
| 480 | "stream.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 481 | "thread.cc", |
| 482 | "thread.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 483 | ] |
| 484 | |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 485 | # TODO(henrike): issue 3307, make rtc_base build with the Chromium default |
| 486 | # compiler settings. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 487 | suppressed_configs += [ "//build/config/compiler:chromium_code" ] |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 488 | configs += [ "//build/config/compiler:no_chromium_code" ] |
| 489 | if (!is_win) { |
| 490 | cflags += [ "-Wno-uninitialized" ] |
| 491 | } |
| 492 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 493 | if (build_with_chromium) { |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 494 | if (is_win) { |
henrikg | ee2bf41 | 2015-09-30 03:48:52 -0700 | [diff] [blame] | 495 | sources += [ "../../webrtc_overrides/webrtc/base/win32socketinit.cc" ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 496 | } |
ehmaldonado | 7495c8c | 2016-12-07 03:30:45 -0800 | [diff] [blame] | 497 | include_dirs = [ "../../boringssl/src/include" ] |
kjellander@webrtc.org | c429b82 | 2015-01-21 20:22:33 +0000 | [diff] [blame] | 498 | public_configs += [ ":rtc_base_chromium_config" ] |
kjellander@webrtc.org | 7497fa7 | 2014-06-28 18:05:22 +0000 | [diff] [blame] | 499 | } else { |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 500 | configs += [ ":rtc_base_warnings_config" ] |
kjellander@webrtc.org | 7497fa7 | 2014-06-28 18:05:22 +0000 | [diff] [blame] | 501 | sources += [ |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 502 | "callback.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 503 | "json.cc", |
| 504 | "json.h", |
tkchin | 9341191 | 2015-07-22 12:12:17 -0700 | [diff] [blame] | 505 | "logsinks.cc", |
| 506 | "logsinks.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 507 | "mathutils.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 508 | "optionsfile.cc", |
| 509 | "optionsfile.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 510 | "rollingaccumulator.h", |
nisse | 2042c16 | 2017-04-10 00:31:33 -0700 | [diff] [blame] | 511 | "scopedptrcollection.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 512 | "sslroots.h", |
kjellander | a8a7ef6 | 2016-04-05 08:13:31 -0700 | [diff] [blame] | 513 | "testbase64.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 514 | "testclient.cc", |
| 515 | "testclient.h", |
nisse | 8e7577c | 2016-10-06 01:37:37 -0700 | [diff] [blame] | 516 | "transformadapter.cc", |
| 517 | "transformadapter.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 518 | "virtualsocketserver.cc", |
| 519 | "virtualsocketserver.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 520 | "window.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 521 | ] |
| 522 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 523 | if (is_win) { |
| 524 | sources += [ |
kjellander@webrtc.org | 7497fa7 | 2014-06-28 18:05:22 +0000 | [diff] [blame] | 525 | "win32socketinit.cc", |
| 526 | "win32socketinit.h", |
| 527 | "win32socketserver.cc", |
| 528 | "win32socketserver.h", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 529 | ] |
| 530 | } |
ehmaldonado | 4bc4d27 | 2016-08-25 04:15:40 -0700 | [diff] [blame] | 531 | |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 532 | if (rtc_build_json) { |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 533 | deps += [ "//third_party/jsoncpp" ] |
| 534 | } else { |
kjellander | ec5c906 | 2016-08-19 01:07:30 -0700 | [diff] [blame] | 535 | include_dirs = [ "$rtc_jsoncpp_root" ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 536 | |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 537 | # When defined changes the include path for json.h to where it is |
| 538 | # expected to be when building json outside of the standalone build. |
| 539 | defines += [ "WEBRTC_EXTERNAL_JSON" ] |
| 540 | } |
kjellander@webrtc.org | 7497fa7 | 2014-06-28 18:05:22 +0000 | [diff] [blame] | 541 | } # !build_with_chromium |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 542 | |
svaldez | 7f7a819 | 2016-04-18 11:13:11 -0700 | [diff] [blame] | 543 | if (rtc_build_ssl) { |
| 544 | deps += [ "//third_party/boringssl" ] |
| 545 | } else { |
kjellander | ec5c906 | 2016-08-19 01:07:30 -0700 | [diff] [blame] | 546 | configs += [ ":external_ssl_library" ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 547 | } |
| 548 | |
| 549 | if (is_android) { |
kjellander@webrtc.org | 7497fa7 | 2014-06-28 18:05:22 +0000 | [diff] [blame] | 550 | sources += [ |
| 551 | "ifaddrs-android.cc", |
| 552 | "ifaddrs-android.h", |
| 553 | ] |
| 554 | |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 555 | libs += [ |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 556 | "log", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 557 | "GLESv2", |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 558 | ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 559 | } |
| 560 | |
kjellander | a8a7ef6 | 2016-04-05 08:13:31 -0700 | [diff] [blame] | 561 | if (is_ios || is_mac) { |
Yuriy Shevchuk | 02ff911 | 2015-05-21 13:50:59 +0200 | [diff] [blame] | 562 | sources += [ |
kjellander | a8a7ef6 | 2016-04-05 08:13:31 -0700 | [diff] [blame] | 563 | "macifaddrs_converter.cc", |
kthelgason | 61abe15 | 2017-03-29 02:32:36 -0700 | [diff] [blame] | 564 | "thread_darwin.mm", |
Yuriy Shevchuk | 02ff911 | 2015-05-21 13:50:59 +0200 | [diff] [blame] | 565 | ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 566 | } |
| 567 | |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 568 | if (use_x11) { |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 569 | libs += [ |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 570 | "dl", |
| 571 | "rt", |
| 572 | "Xext", |
| 573 | "X11", |
| 574 | "Xcomposite", |
| 575 | "Xrender", |
| 576 | ] |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 577 | } |
| 578 | |
| 579 | if (is_linux) { |
| 580 | libs += [ |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 581 | "dl", |
| 582 | "rt", |
| 583 | ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 584 | } |
| 585 | |
| 586 | if (is_mac) { |
kjellander@webrtc.org | 7497fa7 | 2014-06-28 18:05:22 +0000 | [diff] [blame] | 587 | sources += [ |
kjellander@webrtc.org | 7497fa7 | 2014-06-28 18:05:22 +0000 | [diff] [blame] | 588 | "macutils.cc", |
| 589 | "macutils.h", |
| 590 | ] |
kjellander | 3bcedd3 | 2016-06-08 01:14:15 -0700 | [diff] [blame] | 591 | libs += [ |
| 592 | # For ProcessInformationCopyDictionary in unixfilesystem.cc. |
| 593 | "ApplicationServices.framework", |
kjellander | 3bcedd3 | 2016-06-08 01:14:15 -0700 | [diff] [blame] | 594 | ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 595 | } |
| 596 | |
| 597 | if (is_win) { |
kjellander@webrtc.org | 7497fa7 | 2014-06-28 18:05:22 +0000 | [diff] [blame] | 598 | sources += [ |
kjellander@webrtc.org | 7497fa7 | 2014-06-28 18:05:22 +0000 | [diff] [blame] | 599 | "win32.cc", |
| 600 | "win32.h", |
| 601 | "win32filesystem.cc", |
| 602 | "win32filesystem.h", |
| 603 | "win32securityerrors.cc", |
| 604 | "win32window.cc", |
| 605 | "win32window.h", |
kjellander@webrtc.org | 7497fa7 | 2014-06-28 18:05:22 +0000 | [diff] [blame] | 606 | "winping.cc", |
| 607 | "winping.h", |
| 608 | ] |
| 609 | |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 610 | libs += [ |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 611 | "crypt32.lib", |
| 612 | "iphlpapi.lib", |
| 613 | "secur32.lib", |
| 614 | ] |
| 615 | |
| 616 | cflags += [ |
| 617 | # Suppress warnings about WIN32_LEAN_AND_MEAN. |
| 618 | "/wd4005", |
| 619 | "/wd4703", |
| 620 | ] |
| 621 | |
| 622 | defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 623 | } |
| 624 | |
kjellander | a8a7ef6 | 2016-04-05 08:13:31 -0700 | [diff] [blame] | 625 | if (is_posix) { |
| 626 | sources += [ |
| 627 | "ifaddrs_converter.cc", |
| 628 | "ifaddrs_converter.h", |
| 629 | "unixfilesystem.cc", |
| 630 | "unixfilesystem.h", |
| 631 | ] |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 632 | } |
| 633 | |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 634 | if (is_nacl) { |
| 635 | deps += [ "//native_client_sdk/src/libraries/nacl_io" ] |
| 636 | defines += [ "timezone=_timezone" ] |
Guo-wei Shieh | db21f63 | 2016-01-09 13:12:04 -0800 | [diff] [blame] | 637 | sources -= [ "ifaddrs_converter.cc" ] |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 638 | } |
ehmaldonado | 3e3b6f2 | 2016-08-29 02:56:06 -0700 | [diff] [blame] | 639 | if (is_win && is_clang) { |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 640 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 641 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 642 | } |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 643 | } |
tkchin | 42f580e | 2015-11-26 23:18:23 -0800 | [diff] [blame] | 644 | |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 645 | rtc_source_set("gtest_prod") { |
| 646 | sources = [ |
| 647 | "gtest_prod_util.h", |
| 648 | ] |
| 649 | } |
| 650 | |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 651 | if (rtc_include_tests) { |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 652 | config("rtc_base_tests_utils_exported_config") { |
| 653 | defines = [ "GTEST_RELATIVE_PATH" ] |
| 654 | } |
| 655 | |
| 656 | config("rtc_base_tests_utils_warnings_config") { |
| 657 | if (is_win && is_clang) { |
| 658 | cflags = [ |
| 659 | # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6270 |
| 660 | "-Wno-reorder", |
| 661 | "-Wno-sign-compare", |
| 662 | ] |
| 663 | } |
| 664 | } |
| 665 | |
michaelt | 566d820 | 2017-01-12 10:17:38 -0800 | [diff] [blame] | 666 | rtc_source_set("rtc_base_tests_main") { |
| 667 | testonly = true |
| 668 | sources = [ |
| 669 | "unittest_main.cc", |
| 670 | ] |
| 671 | public_configs = [ ":rtc_base_tests_utils_exported_config" ] |
| 672 | deps = [ |
| 673 | ":rtc_base_tests_utils", |
| 674 | ] |
| 675 | public_deps = [ |
| 676 | "//testing/gmock", |
| 677 | "//testing/gtest", |
| 678 | ] |
| 679 | |
| 680 | if (!build_with_chromium && is_clang) { |
| 681 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 682 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 683 | } |
| 684 | } |
| 685 | |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 686 | rtc_source_set("rtc_base_tests_utils") { |
| 687 | testonly = true |
| 688 | sources = [ |
| 689 | # Also use this as a convenient dumping ground for misc files that are |
| 690 | # included by multiple targets below. |
ilnik | 531100d | 2017-02-21 03:33:24 -0800 | [diff] [blame] | 691 | "cpu_time.cc", |
| 692 | "cpu_time.h", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 693 | "fakeclock.cc", |
| 694 | "fakeclock.h", |
| 695 | "fakenetwork.h", |
| 696 | "fakesslidentity.h", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 697 | "firewallsocketserver.cc", |
| 698 | "firewallsocketserver.h", |
| 699 | "gunit.h", |
deadbeef | f137e97 | 2017-03-23 15:45:49 -0700 | [diff] [blame] | 700 | "httpserver.cc", |
| 701 | "httpserver.h", |
ilnik | ab210c8 | 2017-02-28 02:18:27 -0800 | [diff] [blame] | 702 | "memory_usage.cc", |
| 703 | "memory_usage.h", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 704 | "natserver.cc", |
| 705 | "natserver.h", |
| 706 | "natsocketfactory.cc", |
| 707 | "natsocketfactory.h", |
| 708 | "nattypes.cc", |
| 709 | "nattypes.h", |
nisse | 1458462 | 2017-02-13 04:33:28 -0800 | [diff] [blame] | 710 | "proxyserver.cc", |
| 711 | "proxyserver.h", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 712 | "sigslottester.h", |
| 713 | "sigslottester.h.pump", |
| 714 | "testbase64.h", |
| 715 | "testechoserver.h", |
| 716 | "testutils.h", |
| 717 | "timedelta.h", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 718 | ] |
| 719 | configs += [ ":rtc_base_tests_utils_warnings_config" ] |
| 720 | public_configs = [ ":rtc_base_tests_utils_exported_config" ] |
| 721 | deps = [ |
| 722 | ":rtc_base", |
| 723 | "../test:field_trial", |
| 724 | "../test:test_support", |
| 725 | ] |
| 726 | public_deps = [ |
| 727 | "//testing/gmock", |
| 728 | "//testing/gtest", |
| 729 | ] |
| 730 | |
| 731 | if (!build_with_chromium && is_clang) { |
| 732 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 733 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 734 | } |
| 735 | } |
| 736 | |
| 737 | rtc_source_set("rtc_base_nonparallel_tests") { |
| 738 | testonly = true |
| 739 | sources = [ |
ilnik | 531100d | 2017-02-21 03:33:24 -0800 | [diff] [blame] | 740 | "cpu_time_unittest.cc", |
deadbeef | 4024b9b | 2017-02-20 12:07:50 -0800 | [diff] [blame] | 741 | "filerotatingstream_unittest.cc", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 742 | "nullsocketserver_unittest.cc", |
| 743 | "physicalsocketserver_unittest.cc", |
| 744 | "socket_unittest.cc", |
| 745 | "socket_unittest.h", |
| 746 | "socketaddress_unittest.cc", |
| 747 | "virtualsocket_unittest.cc", |
| 748 | ] |
| 749 | deps = [ |
| 750 | ":rtc_base", |
michaelt | 566d820 | 2017-01-12 10:17:38 -0800 | [diff] [blame] | 751 | ":rtc_base_tests_main", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 752 | "//testing/gtest", |
| 753 | ] |
| 754 | if (is_win) { |
| 755 | sources += [ "win32socketserver_unittest.cc" ] |
| 756 | } |
| 757 | |
| 758 | if (!build_with_chromium && is_clang) { |
| 759 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 760 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 761 | } |
| 762 | } |
| 763 | |
| 764 | rtc_source_set("rtc_base_approved_unittests") { |
| 765 | testonly = true |
| 766 | sources = [ |
| 767 | "array_view_unittest.cc", |
| 768 | "atomicops_unittest.cc", |
| 769 | "base64_unittest.cc", |
| 770 | "basictypes_unittest.cc", |
| 771 | "bind_unittest.cc", |
| 772 | "bitbuffer_unittest.cc", |
| 773 | "buffer_unittest.cc", |
| 774 | "bufferqueue_unittest.cc", |
| 775 | "bytebuffer_unittest.cc", |
| 776 | "byteorder_unittest.cc", |
| 777 | "copyonwritebuffer_unittest.cc", |
| 778 | "criticalsection_unittest.cc", |
| 779 | "event_tracer_unittest.cc", |
| 780 | "event_unittest.cc", |
| 781 | "file_unittest.cc", |
| 782 | "function_view_unittest.cc", |
| 783 | "logging_unittest.cc", |
| 784 | "md5digest_unittest.cc", |
| 785 | "mod_ops_unittest.cc", |
| 786 | "onetimeevent_unittest.cc", |
| 787 | "optional_unittest.cc", |
| 788 | "pathutils_unittest.cc", |
| 789 | "platform_thread_unittest.cc", |
| 790 | "random_unittest.cc", |
| 791 | "rate_limiter_unittest.cc", |
| 792 | "rate_statistics_unittest.cc", |
| 793 | "ratetracker_unittest.cc", |
| 794 | "refcountedobject_unittest.cc", |
| 795 | "safe_compare_unittest.cc", |
ossu | a280f7c | 2017-04-06 02:02:15 -0700 | [diff] [blame] | 796 | "string_to_number_unittest.cc", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 797 | "stringencode_unittest.cc", |
| 798 | "stringutils_unittest.cc", |
| 799 | "swap_queue_unittest.cc", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 800 | "thread_annotations_unittest.cc", |
| 801 | "thread_checker_unittest.cc", |
| 802 | "timestampaligner_unittest.cc", |
| 803 | "timeutils_unittest.cc", |
| 804 | ] |
| 805 | deps = [ |
| 806 | ":rtc_base_approved", |
michaelt | 566d820 | 2017-01-12 10:17:38 -0800 | [diff] [blame] | 807 | ":rtc_base_tests_main", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 808 | ] |
| 809 | if (!build_with_chromium && is_clang) { |
| 810 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 811 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 812 | } |
| 813 | } |
| 814 | |
| 815 | rtc_source_set("rtc_task_queue_unittests") { |
| 816 | testonly = true |
| 817 | sources = [ |
| 818 | "sequenced_task_checker_unittest.cc", |
| 819 | "task_queue_unittest.cc", |
| 820 | "weak_ptr_unittest.cc", |
| 821 | ] |
| 822 | deps = [ |
michaelt | 566d820 | 2017-01-12 10:17:38 -0800 | [diff] [blame] | 823 | ":rtc_base_tests_main", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 824 | ":rtc_task_queue", |
| 825 | ] |
| 826 | if (!build_with_chromium && is_clang) { |
| 827 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 828 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 829 | } |
| 830 | } |
| 831 | |
terelius | bc5d921 | 2017-01-13 09:14:33 -0800 | [diff] [blame] | 832 | rtc_source_set("rtc_numerics_unittests") { |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 833 | testonly = true |
| 834 | sources = [ |
terelius | bc5d921 | 2017-01-13 09:14:33 -0800 | [diff] [blame] | 835 | "numerics/exp_filter_unittest.cc", |
| 836 | "numerics/percentile_filter_unittest.cc", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 837 | ] |
| 838 | deps = [ |
michaelt | 566d820 | 2017-01-12 10:17:38 -0800 | [diff] [blame] | 839 | ":rtc_base_tests_main", |
terelius | bc5d921 | 2017-01-13 09:14:33 -0800 | [diff] [blame] | 840 | ":rtc_numerics", |
ehmaldonado | 894c2bb | 2017-01-05 06:03:24 -0800 | [diff] [blame] | 841 | ] |
| 842 | } |
| 843 | |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 844 | config("rtc_base_unittests_config") { |
| 845 | if (is_clang) { |
| 846 | cflags = [ "-Wno-unused-const-variable" ] |
| 847 | } |
| 848 | } |
| 849 | rtc_source_set("rtc_base_unittests") { |
| 850 | testonly = true |
| 851 | sources = [ |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 852 | "callback_unittest.cc", |
| 853 | "crc32_unittest.cc", |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 854 | "fileutils_unittest.cc", |
| 855 | "helpers_unittest.cc", |
deadbeef | f137e97 | 2017-03-23 15:45:49 -0700 | [diff] [blame] | 856 | "httpbase_unittest.cc", |
| 857 | "httpcommon_unittest.cc", |
| 858 | "httpserver_unittest.cc", |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 859 | "ipaddress_unittest.cc", |
ilnik | ab210c8 | 2017-02-28 02:18:27 -0800 | [diff] [blame] | 860 | "memory_usage_unittest.cc", |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 861 | "messagedigest_unittest.cc", |
| 862 | "messagequeue_unittest.cc", |
| 863 | "nat_unittest.cc", |
| 864 | "network_unittest.cc", |
| 865 | "optionsfile_unittest.cc", |
deadbeef | f137e97 | 2017-03-23 15:45:49 -0700 | [diff] [blame] | 866 | "proxy_unittest.cc", |
zstein | f42cc9d | 2017-03-27 16:17:19 -0700 | [diff] [blame] | 867 | "ptr_util_unittest.cc", |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 868 | "ratelimiter_unittest.cc", |
| 869 | "rollingaccumulator_unittest.cc", |
| 870 | "rtccertificate_unittest.cc", |
| 871 | "rtccertificategenerator_unittest.cc", |
nisse | 2042c16 | 2017-04-10 00:31:33 -0700 | [diff] [blame] | 872 | "scopedptrcollection_unittest.cc", |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 873 | "sha1digest_unittest.cc", |
| 874 | "sharedexclusivelock_unittest.cc", |
| 875 | "signalthread_unittest.cc", |
| 876 | "sigslot_unittest.cc", |
| 877 | "sigslottester_unittest.cc", |
| 878 | "stream_unittest.cc", |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 879 | "testclient_unittest.cc", |
| 880 | "thread_unittest.cc", |
| 881 | ] |
| 882 | if (is_win) { |
| 883 | sources += [ |
| 884 | "win32_unittest.cc", |
| 885 | "win32window_unittest.cc", |
| 886 | ] |
| 887 | } |
| 888 | if (is_mac) { |
| 889 | sources += [ "macutils_unittest.cc" ] |
| 890 | } |
| 891 | if (is_posix) { |
| 892 | sources += [ |
| 893 | "ssladapter_unittest.cc", |
| 894 | "sslidentity_unittest.cc", |
| 895 | "sslstreamadapter_unittest.cc", |
| 896 | ] |
| 897 | } |
| 898 | deps = [ |
michaelt | 566d820 | 2017-01-12 10:17:38 -0800 | [diff] [blame] | 899 | ":rtc_base_tests_main", |
ehmaldonado | da8dcfb | 2017-01-04 07:11:23 -0800 | [diff] [blame] | 900 | ] |
| 901 | public_deps = [ |
| 902 | ":rtc_base", |
| 903 | ] |
| 904 | configs += [ ":rtc_base_unittests_config" ] |
| 905 | if (!build_with_chromium && is_clang) { |
| 906 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 907 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 908 | } |
| 909 | } |
| 910 | } |
| 911 | |
mbonadei | 3c9151b | 2017-01-20 06:48:03 -0800 | [diff] [blame] | 912 | if (is_android) { |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 913 | android_library("base_java") { |
| 914 | java_files = [ |
| 915 | "java/src/org/webrtc/Logging.java", |
| 916 | "java/src/org/webrtc/Size.java", |
| 917 | "java/src/org/webrtc/ThreadUtils.java", |
| 918 | ] |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 919 | } |
| 920 | } |