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