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