Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1 | # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
Henrik Kjellander | 73e2180 | 2017-06-20 08:38:58 +0200 | [diff] [blame] | 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 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 9 | import("//build/config/crypto.gni") |
| 10 | import("//build/config/ui.gni") |
Henrik Kjellander | 73e2180 | 2017-06-20 08:38:58 +0200 | [diff] [blame] | 11 | import("../webrtc.gni") |
| 12 | |
| 13 | if (is_android) { |
| 14 | import("//build/config/android/config.gni") |
| 15 | import("//build/config/android/rules.gni") |
| 16 | } |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 17 | if (is_win) { |
| 18 | import("//build/config/clang/clang.gni") |
| 19 | } |
Henrik Kjellander | 73e2180 | 2017-06-20 08:38:58 +0200 | [diff] [blame] | 20 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 21 | group("base") { |
| 22 | public_deps = [ |
| 23 | ":rtc_base", |
| 24 | ":rtc_base_approved", |
| 25 | ":rtc_task_queue", |
| 26 | ":sequenced_task_checker", |
| 27 | ":weak_ptr", |
| 28 | ] |
Henrik Kjellander | 73e2180 | 2017-06-20 08:38:58 +0200 | [diff] [blame] | 29 | if (is_android) { |
| 30 | public_deps += [ ":base_java" ] |
| 31 | } |
| 32 | } |
| 33 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 34 | config("rtc_base_chromium_config") { |
| 35 | defines = [ "NO_MAIN_THREAD_WRAPPING" ] |
| 36 | } |
| 37 | |
| 38 | config("rtc_base_all_dependent_config") { |
| 39 | if (is_ios) { |
| 40 | libs = [ |
| 41 | "CFNetwork.framework", |
| 42 | "Security.framework", |
| 43 | "SystemConfiguration.framework", |
| 44 | "UIKit.framework", |
| 45 | ] |
| 46 | } |
| 47 | if (is_mac) { |
| 48 | libs = [ |
| 49 | "Cocoa.framework", |
| 50 | "Foundation.framework", |
| 51 | "IOKit.framework", |
| 52 | "Security.framework", |
| 53 | "SystemConfiguration.framework", |
| 54 | ] |
| 55 | } |
| 56 | } |
| 57 | |
Dan Minor | 9cdd876 | 2018-01-16 10:40:39 -0500 | [diff] [blame] | 58 | if (!rtc_build_ssl) { |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 59 | config("external_ssl_library") { |
| 60 | assert(rtc_ssl_root != "", |
| 61 | "You must specify rtc_ssl_root when rtc_build_ssl==0.") |
| 62 | include_dirs = [ rtc_ssl_root ] |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | source_set("protobuf_utils") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 67 | visibility = [ "*" ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 68 | sources = [ |
| 69 | "protobuf_utils.h", |
| 70 | ] |
| 71 | if (rtc_enable_protobuf) { |
| 72 | public_deps = [ |
| 73 | "//third_party/protobuf:protobuf_lite", |
| 74 | ] |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | source_set("compile_assert_c") { |
| 79 | sources = [ |
| 80 | "compile_assert_c.h", |
| 81 | ] |
| 82 | } |
| 83 | |
mbonadei | bc37847 | 2017-09-11 03:43:34 -0700 | [diff] [blame] | 84 | rtc_source_set("rtc_base_approved") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 85 | visibility = [ "*" ] |
mbonadei | bc37847 | 2017-09-11 03:43:34 -0700 | [diff] [blame] | 86 | public_deps = [ |
| 87 | ":rtc_base_approved_generic", |
| 88 | ] |
| 89 | if (is_mac && !build_with_chromium) { |
| 90 | public_deps += [ ":rtc_base_approved_objc" ] |
| 91 | } |
| 92 | } |
| 93 | |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 94 | rtc_source_set("checks") { |
| 95 | sources = [ |
| 96 | "checks.cc", |
| 97 | "checks.h", |
| 98 | ] |
| 99 | deps = [ |
| 100 | ":safe_compare", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 101 | "..:typedefs", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 102 | ] |
| 103 | } |
| 104 | |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 105 | rtc_source_set("rate_limiter") { |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 106 | sources = [ |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 107 | "rate_limiter.cc", |
| 108 | "rate_limiter.h", |
| 109 | ] |
| 110 | deps = [ |
| 111 | ":rtc_base_approved", |
| 112 | "../system_wrappers", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 113 | ] |
| 114 | } |
| 115 | |
| 116 | rtc_source_set("sanitizer") { |
| 117 | sources = [ |
| 118 | "sanitizer.h", |
| 119 | ] |
| 120 | } |
| 121 | |
| 122 | rtc_source_set("safe_compare") { |
| 123 | sources = [ |
| 124 | "numerics/safe_compare.h", |
| 125 | ] |
| 126 | deps = [ |
| 127 | ":type_traits", |
| 128 | ] |
| 129 | } |
| 130 | |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 131 | rtc_source_set("stringutils") { |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 132 | sources = [ |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 133 | "stringutils.cc", |
| 134 | "stringutils.h", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 135 | ] |
| 136 | deps = [ |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 137 | ":checks", |
| 138 | ] |
| 139 | } |
| 140 | |
| 141 | rtc_source_set("type_traits") { |
| 142 | sources = [ |
| 143 | "type_traits.h", |
| 144 | ] |
| 145 | } |
| 146 | |
| 147 | rtc_source_set("deprecation") { |
| 148 | sources = [ |
| 149 | "deprecation.h", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 150 | ] |
| 151 | } |
| 152 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 153 | # The subset of rtc_base approved for use outside of libjingle. |
mbonadei | bc37847 | 2017-09-11 03:43:34 -0700 | [diff] [blame] | 154 | rtc_source_set("rtc_base_approved_generic") { |
| 155 | visibility = [ |
| 156 | ":rtc_base_approved", |
| 157 | ":rtc_base_approved_objc", |
Tommi | 897e136 | 2017-12-01 18:56:43 +0100 | [diff] [blame] | 158 | ":weak_ptr_unittests", |
mbonadei | bc37847 | 2017-09-11 03:43:34 -0700 | [diff] [blame] | 159 | ] |
| 160 | |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 161 | cflags = [] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 162 | defines = [] |
| 163 | libs = [] |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 164 | deps = [ |
| 165 | ":checks", |
| 166 | ":safe_compare", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 167 | ":stringutils", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 168 | ":type_traits", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 169 | "../:typedefs", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 170 | ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 171 | |
| 172 | sources = [ |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 173 | "arraysize.h", |
| 174 | "atomicops.h", |
| 175 | "base64.cc", |
| 176 | "base64.h", |
| 177 | "basictypes.h", |
| 178 | "bind.h", |
| 179 | "bitbuffer.cc", |
| 180 | "bitbuffer.h", |
Alex Narest | 78609d5 | 2017-10-20 10:37:47 +0200 | [diff] [blame] | 181 | "bitrateallocationstrategy.cc", |
| 182 | "bitrateallocationstrategy.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 183 | "buffer.h", |
| 184 | "bufferqueue.cc", |
| 185 | "bufferqueue.h", |
| 186 | "bytebuffer.cc", |
| 187 | "bytebuffer.h", |
| 188 | "byteorder.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 189 | "constructormagic.h", |
| 190 | "copyonwritebuffer.cc", |
| 191 | "copyonwritebuffer.h", |
| 192 | "criticalsection.cc", |
| 193 | "criticalsection.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 194 | "event_tracer.cc", |
| 195 | "event_tracer.h", |
| 196 | "file.cc", |
| 197 | "file.h", |
| 198 | "flags.cc", |
| 199 | "flags.h", |
| 200 | "format_macros.h", |
| 201 | "function_view.h", |
| 202 | "ignore_wundef.h", |
| 203 | "location.cc", |
| 204 | "location.h", |
Karl Wiberg | 65c3922 | 2017-11-22 12:25:14 +0100 | [diff] [blame] | 205 | "numerics/histogram_percentile_counter.cc", |
| 206 | "numerics/histogram_percentile_counter.h", |
| 207 | "numerics/mod_ops.h", |
| 208 | "numerics/moving_max_counter.h", |
Karl Wiberg | e40468b | 2017-11-22 10:42:26 +0100 | [diff] [blame] | 209 | "numerics/safe_conversions.h", |
| 210 | "numerics/safe_conversions_impl.h", |
| 211 | "numerics/safe_minmax.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 212 | "onetimeevent.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 213 | "pathutils.cc", |
| 214 | "pathutils.h", |
| 215 | "platform_file.cc", |
| 216 | "platform_file.h", |
| 217 | "platform_thread.cc", |
| 218 | "platform_thread.h", |
| 219 | "platform_thread_types.h", |
| 220 | "ptr_util.h", |
| 221 | "race_checker.cc", |
| 222 | "race_checker.h", |
| 223 | "random.cc", |
| 224 | "random.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 225 | "rate_statistics.cc", |
| 226 | "rate_statistics.h", |
| 227 | "ratetracker.cc", |
| 228 | "ratetracker.h", |
| 229 | "refcount.h", |
| 230 | "refcountedobject.h", |
Niels Möller | 9155e49 | 2017-10-23 11:22:30 +0200 | [diff] [blame] | 231 | "refcounter.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 232 | "scoped_ref_ptr.h", |
| 233 | "string_to_number.cc", |
| 234 | "string_to_number.h", |
| 235 | "stringencode.cc", |
| 236 | "stringencode.h", |
| 237 | "stringize_macros.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 238 | "swap_queue.h", |
| 239 | "template_util.h", |
| 240 | "thread_annotations.h", |
| 241 | "thread_checker.h", |
| 242 | "thread_checker_impl.cc", |
| 243 | "thread_checker_impl.h", |
| 244 | "timestampaligner.cc", |
| 245 | "timestampaligner.h", |
| 246 | "timeutils.cc", |
| 247 | "timeutils.h", |
| 248 | "trace_event.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 249 | ] |
| 250 | |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 251 | deps += [ |
| 252 | "..:webrtc_common", |
| 253 | "../api:array_view", |
| 254 | "../api:optional", |
| 255 | ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 256 | |
| 257 | if (is_android) { |
| 258 | libs += [ "log" ] |
| 259 | } |
| 260 | |
| 261 | if (is_posix) { |
| 262 | sources += [ "file_posix.cc" ] |
| 263 | } |
| 264 | |
| 265 | if (is_win) { |
| 266 | sources += [ "file_win.cc" ] |
| 267 | } |
| 268 | |
| 269 | if (build_with_chromium) { |
| 270 | # Dependency on chromium's logging (in //base). |
| 271 | deps += [ "//base:base" ] |
| 272 | sources += [ |
Tommi | 06483ca | 2017-11-26 18:22:52 +0100 | [diff] [blame] | 273 | "../../webrtc_overrides/rtc_base/event.cc", |
| 274 | "../../webrtc_overrides/rtc_base/event.h", |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 275 | "../../webrtc_overrides/rtc_base/logging.cc", |
| 276 | "../../webrtc_overrides/rtc_base/logging.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 277 | ] |
| 278 | } else { |
| 279 | sources += [ |
Tommi | 06483ca | 2017-11-26 18:22:52 +0100 | [diff] [blame] | 280 | "event.cc", |
| 281 | "event.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 282 | "logging.cc", |
| 283 | "logging.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 284 | ] |
| 285 | } |
| 286 | if (is_component_build && is_win) { |
| 287 | # Copy the VS runtime DLLs into the isolate so that they don't have to be |
| 288 | # preinstalled on the target machine. The debug runtimes have a "d" at |
| 289 | # the end. |
| 290 | # This is a copy of https://codereview.chromium.org/1783973002. |
| 291 | # TODO(ehmaldonado): We'd like Chromium to make this changes easier to use, |
| 292 | # so we don't have to copy their changes and risk breakages. |
| 293 | # See http://crbug.com/653569 |
| 294 | if (is_debug) { |
| 295 | vcrt_suffix = "d" |
| 296 | } else { |
| 297 | vcrt_suffix = "" |
| 298 | } |
| 299 | |
| 300 | # These runtime files are copied to the output directory by the |
| 301 | # vs_toolchain script that runs as part of toolchain configuration. |
| 302 | data = [ |
| 303 | "$root_out_dir/msvcp140${vcrt_suffix}.dll", |
| 304 | "$root_out_dir/vccorlib140${vcrt_suffix}.dll", |
| 305 | "$root_out_dir/vcruntime140${vcrt_suffix}.dll", |
| 306 | |
| 307 | # Universal Windows 10 CRT files |
| 308 | "$root_out_dir/api-ms-win-core-console-l1-1-0.dll", |
| 309 | "$root_out_dir/api-ms-win-core-datetime-l1-1-0.dll", |
| 310 | "$root_out_dir/api-ms-win-core-debug-l1-1-0.dll", |
| 311 | "$root_out_dir/api-ms-win-core-errorhandling-l1-1-0.dll", |
| 312 | "$root_out_dir/api-ms-win-core-file-l1-1-0.dll", |
| 313 | "$root_out_dir/api-ms-win-core-file-l1-2-0.dll", |
| 314 | "$root_out_dir/api-ms-win-core-file-l2-1-0.dll", |
| 315 | "$root_out_dir/api-ms-win-core-handle-l1-1-0.dll", |
| 316 | "$root_out_dir/api-ms-win-core-heap-l1-1-0.dll", |
| 317 | "$root_out_dir/api-ms-win-core-interlocked-l1-1-0.dll", |
| 318 | "$root_out_dir/api-ms-win-core-libraryloader-l1-1-0.dll", |
| 319 | "$root_out_dir/api-ms-win-core-localization-l1-2-0.dll", |
| 320 | "$root_out_dir/api-ms-win-core-memory-l1-1-0.dll", |
| 321 | "$root_out_dir/api-ms-win-core-namedpipe-l1-1-0.dll", |
| 322 | "$root_out_dir/api-ms-win-core-processenvironment-l1-1-0.dll", |
| 323 | "$root_out_dir/api-ms-win-core-processthreads-l1-1-0.dll", |
| 324 | "$root_out_dir/api-ms-win-core-processthreads-l1-1-1.dll", |
| 325 | "$root_out_dir/api-ms-win-core-profile-l1-1-0.dll", |
| 326 | "$root_out_dir/api-ms-win-core-rtlsupport-l1-1-0.dll", |
| 327 | "$root_out_dir/api-ms-win-core-string-l1-1-0.dll", |
| 328 | "$root_out_dir/api-ms-win-core-synch-l1-1-0.dll", |
| 329 | "$root_out_dir/api-ms-win-core-synch-l1-2-0.dll", |
| 330 | "$root_out_dir/api-ms-win-core-sysinfo-l1-1-0.dll", |
| 331 | "$root_out_dir/api-ms-win-core-timezone-l1-1-0.dll", |
| 332 | "$root_out_dir/api-ms-win-core-util-l1-1-0.dll", |
| 333 | "$root_out_dir/api-ms-win-crt-conio-l1-1-0.dll", |
| 334 | "$root_out_dir/api-ms-win-crt-convert-l1-1-0.dll", |
| 335 | "$root_out_dir/api-ms-win-crt-environment-l1-1-0.dll", |
| 336 | "$root_out_dir/api-ms-win-crt-filesystem-l1-1-0.dll", |
| 337 | "$root_out_dir/api-ms-win-crt-heap-l1-1-0.dll", |
| 338 | "$root_out_dir/api-ms-win-crt-locale-l1-1-0.dll", |
| 339 | "$root_out_dir/api-ms-win-crt-math-l1-1-0.dll", |
| 340 | "$root_out_dir/api-ms-win-crt-multibyte-l1-1-0.dll", |
| 341 | "$root_out_dir/api-ms-win-crt-private-l1-1-0.dll", |
| 342 | "$root_out_dir/api-ms-win-crt-process-l1-1-0.dll", |
| 343 | "$root_out_dir/api-ms-win-crt-runtime-l1-1-0.dll", |
| 344 | "$root_out_dir/api-ms-win-crt-stdio-l1-1-0.dll", |
| 345 | "$root_out_dir/api-ms-win-crt-string-l1-1-0.dll", |
| 346 | "$root_out_dir/api-ms-win-crt-time-l1-1-0.dll", |
| 347 | "$root_out_dir/api-ms-win-crt-utility-l1-1-0.dll", |
| 348 | "$root_out_dir/ucrtbase${vcrt_suffix}.dll", |
| 349 | ] |
| 350 | if (is_asan) { |
| 351 | if (current_cpu == "x64") { |
| 352 | data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-x86_64.dll" ] |
| 353 | } else { |
| 354 | data += [ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-i386.dll" ] |
| 355 | } |
| 356 | } |
| 357 | } |
| 358 | if (is_nacl) { |
| 359 | deps += [ "//native_client_sdk/src/libraries/nacl_io" ] |
| 360 | } |
| 361 | } |
| 362 | |
mbonadei | bc37847 | 2017-09-11 03:43:34 -0700 | [diff] [blame] | 363 | if (is_mac && !build_with_chromium) { |
| 364 | config("rtc_base_approved_objc_all_dependent_config") { |
| 365 | visibility = [ ":rtc_base_approved_objc" ] |
| 366 | libs = [ "Foundation.framework" ] # needed for logging_mac.mm |
| 367 | } |
| 368 | |
| 369 | rtc_source_set("rtc_base_approved_objc") { |
| 370 | visibility = [ ":rtc_base_approved" ] |
| 371 | all_dependent_configs = [ ":rtc_base_approved_objc_all_dependent_config" ] |
| 372 | sources = [ |
| 373 | "logging_mac.mm", |
| 374 | ] |
| 375 | deps = [ |
| 376 | ":rtc_base_approved_generic", |
| 377 | ] |
| 378 | } |
| 379 | } |
| 380 | |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 381 | rtc_source_set("rtc_task_queue") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 382 | visibility = [ "*" ] |
mbonadei | 95c8f65 | 2017-08-27 23:40:10 -0700 | [diff] [blame] | 383 | deps = [ |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 384 | ":rtc_base_approved", |
mbonadei | 95c8f65 | 2017-08-27 23:40:10 -0700 | [diff] [blame] | 385 | ] |
| 386 | public_deps = [ |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 387 | ":rtc_task_queue_api", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 388 | ] |
| 389 | |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 390 | if (rtc_link_task_queue_impl) { |
mbonadei | 95c8f65 | 2017-08-27 23:40:10 -0700 | [diff] [blame] | 391 | deps += [ ":rtc_task_queue_impl" ] |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 392 | } |
| 393 | } |
| 394 | |
| 395 | # WebRTC targets must not directly depend on rtc_task_queue_api or |
| 396 | # rtc_task_queue_impl. Instead, depend on rtc_task_queue. |
| 397 | # The build flag |rtc_link_task_queue_impl| decides if WebRTC targets will link |
| 398 | # to the default implemenation in rtc_task_queue_impl or if an externally |
| 399 | # provided implementation should be used. An external implementation should |
| 400 | # depend on rtc_task_queue_api. |
| 401 | rtc_source_set("rtc_task_queue_api") { |
nisse | 75dd6d4 | 2017-09-19 08:28:00 -0700 | [diff] [blame] | 402 | sources = [ |
| 403 | "task_queue.h", |
| 404 | ] |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 405 | deps = [ |
| 406 | ":rtc_base_approved", |
| 407 | ] |
| 408 | } |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 409 | |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 410 | rtc_source_set("rtc_task_queue_impl") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 411 | visibility = [ "*" ] |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 412 | deps = [ |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 413 | ":checks", |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 414 | ":rtc_base_approved", |
| 415 | ":rtc_task_queue_api", |
| 416 | ] |
Niels Möller | 15c9cf7 | 2017-10-19 12:38:09 +0200 | [diff] [blame] | 417 | if (rtc_build_libevent) { |
| 418 | deps += [ "//base/third_party/libevent" ] |
| 419 | } |
| 420 | if (rtc_enable_libevent) { |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 421 | sources = [ |
Niels Möller | 15c9cf7 | 2017-10-19 12:38:09 +0200 | [diff] [blame] | 422 | "task_queue_libevent.cc", |
| 423 | "task_queue_posix.cc", |
| 424 | "task_queue_posix.h", |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 425 | ] |
| 426 | } else { |
Niels Möller | 15c9cf7 | 2017-10-19 12:38:09 +0200 | [diff] [blame] | 427 | if (is_mac || is_ios) { |
Niels Möller | 17a0474 | 2017-09-27 10:53:21 +0200 | [diff] [blame] | 428 | sources = [ |
Niels Möller | 15c9cf7 | 2017-10-19 12:38:09 +0200 | [diff] [blame] | 429 | "task_queue_gcd.cc", |
Henrik Boström | a9a2771 | 2017-10-03 08:01:07 +0000 | [diff] [blame] | 430 | "task_queue_posix.cc", |
| 431 | "task_queue_posix.h", |
Niels Möller | 17a0474 | 2017-09-27 10:53:21 +0200 | [diff] [blame] | 432 | ] |
Niels Möller | 15c9cf7 | 2017-10-19 12:38:09 +0200 | [diff] [blame] | 433 | } |
| 434 | if (is_win) { |
| 435 | sources = [ |
| 436 | "task_queue_win.cc", |
| 437 | ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 438 | } |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | rtc_static_library("sequenced_task_checker") { |
| 443 | sources = [ |
| 444 | "sequenced_task_checker.h", |
| 445 | "sequenced_task_checker_impl.cc", |
| 446 | "sequenced_task_checker_impl.h", |
| 447 | ] |
| 448 | deps = [ |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 449 | ":checks", |
mbonadei | 95c8f65 | 2017-08-27 23:40:10 -0700 | [diff] [blame] | 450 | ":rtc_base_approved", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 451 | ":rtc_task_queue", |
| 452 | ] |
| 453 | } |
| 454 | |
| 455 | rtc_static_library("weak_ptr") { |
| 456 | sources = [ |
| 457 | "weak_ptr.cc", |
| 458 | "weak_ptr.h", |
| 459 | ] |
| 460 | deps = [ |
| 461 | ":rtc_base_approved", |
| 462 | ":sequenced_task_checker", |
| 463 | ] |
| 464 | } |
| 465 | |
| 466 | rtc_static_library("rtc_numerics") { |
| 467 | sources = [ |
| 468 | "numerics/exp_filter.cc", |
| 469 | "numerics/exp_filter.h", |
Ilya Nikolaevskiy | b968575 | 2017-11-01 14:01:00 +0100 | [diff] [blame] | 470 | "numerics/moving_median_filter.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 471 | "numerics/percentile_filter.h", |
Bjorn Terelius | a194e58 | 2017-10-25 13:07:09 +0200 | [diff] [blame] | 472 | "numerics/sequence_number_util.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 473 | ] |
| 474 | deps = [ |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 475 | ":checks", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 476 | ":rtc_base_approved", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 477 | ":safe_compare", |
Bjorn Terelius | a194e58 | 2017-10-25 13:07:09 +0200 | [diff] [blame] | 478 | "../api:optional", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 479 | ] |
| 480 | } |
| 481 | |
| 482 | config("rtc_base_warnings_config") { |
| 483 | if (is_win && is_clang) { |
| 484 | cflags = [ |
| 485 | # Disable warnings failing when compiling with Clang on Windows. |
| 486 | # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 |
| 487 | "-Wno-sign-compare", |
| 488 | "-Wno-missing-braces", |
| 489 | ] |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | rtc_source_set("rtc_json") { |
| 494 | defines = [] |
| 495 | sources = [ |
| 496 | "json.cc", |
| 497 | "json.h", |
| 498 | ] |
| 499 | if (rtc_build_json) { |
| 500 | public_deps = [ |
| 501 | "//third_party/jsoncpp", |
| 502 | ] |
| 503 | } else { |
| 504 | include_dirs = [ "$rtc_jsoncpp_root" ] |
| 505 | |
| 506 | # When defined changes the include path for json.h to where it is |
| 507 | # expected to be when building json outside of the standalone build. |
| 508 | defines += [ "WEBRTC_EXTERNAL_JSON" ] |
| 509 | } |
| 510 | } |
| 511 | |
mbonadei | 9c5e511 | 2017-09-05 05:17:02 -0700 | [diff] [blame] | 512 | rtc_static_library("rtc_base") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 513 | visibility = [ "*" ] |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 514 | public_deps = [] |
| 515 | if (!build_with_mozilla) { |
| 516 | public_deps += [ ":rtc_base_generic" ] |
| 517 | } |
mbonadei | 310e32b | 2017-09-07 07:36:28 -0700 | [diff] [blame] | 518 | if (is_win) { |
| 519 | sources = [ |
| 520 | "noop.cc", |
| 521 | ] |
| 522 | } |
| 523 | if (is_ios || is_mac) { |
| 524 | sources = [ |
| 525 | "noop.mm", |
| 526 | ] |
| 527 | public_deps += [ ":rtc_base_objc" ] |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | if (is_ios || is_mac) { |
| 532 | rtc_source_set("rtc_base_objc") { |
| 533 | sources = [ |
| 534 | "thread_darwin.mm", |
| 535 | ] |
| 536 | deps = [ |
| 537 | ":rtc_base_generic", |
| 538 | ] |
| 539 | visibility = [ ":rtc_base" ] |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | rtc_static_library("rtc_base_generic") { |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 544 | cflags = [] |
| 545 | cflags_cc = [] |
| 546 | libs = [] |
| 547 | defines = [] |
| 548 | deps = [ |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 549 | ":checks", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 550 | ":stringutils", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 551 | "..:webrtc_common", |
Joachim Bauch | 58daf40 | 2017-12-21 22:00:34 +0100 | [diff] [blame] | 552 | "../api:array_view", |
kwiberg | 84f6a3f | 2017-09-05 08:43:13 -0700 | [diff] [blame] | 553 | "../api:optional", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 554 | ] |
| 555 | public_deps = [ |
| 556 | ":rtc_base_approved", |
| 557 | ] |
| 558 | public_configs = [] |
| 559 | |
| 560 | all_dependent_configs = [ ":rtc_base_all_dependent_config" ] |
| 561 | |
| 562 | sources = [ |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 563 | "asyncinvoker-inl.h", |
| 564 | "asyncinvoker.cc", |
| 565 | "asyncinvoker.h", |
| 566 | "asyncpacketsocket.cc", |
| 567 | "asyncpacketsocket.h", |
| 568 | "asyncresolverinterface.cc", |
| 569 | "asyncresolverinterface.h", |
| 570 | "asyncsocket.cc", |
| 571 | "asyncsocket.h", |
| 572 | "asynctcpsocket.cc", |
| 573 | "asynctcpsocket.h", |
| 574 | "asyncudpsocket.cc", |
| 575 | "asyncudpsocket.h", |
| 576 | "crc32.cc", |
| 577 | "crc32.h", |
| 578 | "cryptstring.cc", |
| 579 | "cryptstring.h", |
Patrik Höglund | 76df0df | 2017-12-19 11:50:21 +0100 | [diff] [blame] | 580 | "dscp.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 581 | "filerotatingstream.cc", |
| 582 | "filerotatingstream.h", |
| 583 | "fileutils.cc", |
| 584 | "fileutils.h", |
| 585 | "gunit_prod.h", |
| 586 | "helpers.cc", |
| 587 | "helpers.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 588 | "httpcommon-inl.h", |
| 589 | "httpcommon.cc", |
| 590 | "httpcommon.h", |
| 591 | "ipaddress.cc", |
| 592 | "ipaddress.h", |
Patrik Höglund | 76df0df | 2017-12-19 11:50:21 +0100 | [diff] [blame] | 593 | "keep_ref_until_done.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 594 | "messagedigest.cc", |
| 595 | "messagedigest.h", |
| 596 | "messagehandler.cc", |
| 597 | "messagehandler.h", |
| 598 | "messagequeue.cc", |
| 599 | "messagequeue.h", |
Zhi Huang | 942bc2e | 2017-11-13 13:26:07 -0800 | [diff] [blame] | 600 | "nethelper.cc", |
| 601 | "nethelper.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 602 | "nethelpers.cc", |
| 603 | "nethelpers.h", |
| 604 | "network.cc", |
| 605 | "network.h", |
Patrik Höglund | e2d6a06 | 2017-10-05 14:53:33 +0200 | [diff] [blame] | 606 | "network_constants.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 607 | "networkmonitor.cc", |
| 608 | "networkmonitor.h", |
Patrik Höglund | 76df0df | 2017-12-19 11:50:21 +0100 | [diff] [blame] | 609 | "networkroute.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 610 | "nullsocketserver.cc", |
| 611 | "nullsocketserver.h", |
| 612 | "openssl.h", |
| 613 | "openssladapter.cc", |
| 614 | "openssladapter.h", |
| 615 | "openssldigest.cc", |
| 616 | "openssldigest.h", |
| 617 | "opensslidentity.cc", |
| 618 | "opensslidentity.h", |
| 619 | "opensslstreamadapter.cc", |
| 620 | "opensslstreamadapter.h", |
| 621 | "physicalsocketserver.cc", |
| 622 | "physicalsocketserver.h", |
| 623 | "proxyinfo.cc", |
| 624 | "proxyinfo.h", |
| 625 | "ratelimiter.cc", |
| 626 | "ratelimiter.h", |
| 627 | "rtccertificate.cc", |
| 628 | "rtccertificate.h", |
| 629 | "rtccertificategenerator.cc", |
| 630 | "rtccertificategenerator.h", |
deadbeef | 8290ddf | 2017-07-11 16:56:05 -0700 | [diff] [blame] | 631 | "signalthread.cc", |
| 632 | "signalthread.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 633 | "sigslot.cc", |
| 634 | "sigslot.h", |
Taylor Brandstetter | e68b6c9 | 2017-10-05 09:13:55 -0700 | [diff] [blame] | 635 | "sigslotrepeater.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 636 | "socket.h", |
| 637 | "socketadapters.cc", |
| 638 | "socketadapters.h", |
| 639 | "socketaddress.cc", |
| 640 | "socketaddress.h", |
| 641 | "socketaddresspair.cc", |
| 642 | "socketaddresspair.h", |
| 643 | "socketfactory.h", |
| 644 | "socketserver.h", |
| 645 | "socketstream.cc", |
| 646 | "socketstream.h", |
| 647 | "ssladapter.cc", |
| 648 | "ssladapter.h", |
| 649 | "sslfingerprint.cc", |
| 650 | "sslfingerprint.h", |
| 651 | "sslidentity.cc", |
| 652 | "sslidentity.h", |
| 653 | "sslstreamadapter.cc", |
| 654 | "sslstreamadapter.h", |
| 655 | "stream.cc", |
| 656 | "stream.h", |
| 657 | "thread.cc", |
| 658 | "thread.h", |
Joachim Bauch | 58daf40 | 2017-12-21 22:00:34 +0100 | [diff] [blame] | 659 | "zero_memory.cc", |
| 660 | "zero_memory.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 661 | ] |
| 662 | |
mbonadei | 310e32b | 2017-09-07 07:36:28 -0700 | [diff] [blame] | 663 | visibility = [ |
| 664 | ":rtc_base", |
| 665 | ":rtc_base_objc", |
| 666 | ] |
| 667 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 668 | # TODO(henrike): issue 3307, make rtc_base build with the Chromium default |
| 669 | # compiler settings. |
| 670 | suppressed_configs += [ "//build/config/compiler:chromium_code" ] |
| 671 | configs += [ "//build/config/compiler:no_chromium_code" ] |
| 672 | if (!is_win) { |
| 673 | cflags += [ "-Wno-uninitialized" ] |
| 674 | } |
| 675 | |
| 676 | if (build_with_chromium) { |
| 677 | if (is_win) { |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 678 | sources += [ "../../webrtc_overrides/rtc_base/win32socketinit.cc" ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 679 | } |
| 680 | include_dirs = [ "../../boringssl/src/include" ] |
| 681 | public_configs += [ ":rtc_base_chromium_config" ] |
| 682 | } else { |
| 683 | configs += [ ":rtc_base_warnings_config" ] |
| 684 | sources += [ |
| 685 | "callback.h", |
| 686 | "logsinks.cc", |
| 687 | "logsinks.h", |
Karl Wiberg | 65c3922 | 2017-11-22 12:25:14 +0100 | [diff] [blame] | 688 | "numerics/mathutils.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 689 | "optionsfile.cc", |
| 690 | "optionsfile.h", |
| 691 | "rollingaccumulator.h", |
| 692 | "sslroots.h", |
| 693 | "transformadapter.cc", |
| 694 | "transformadapter.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 695 | ] |
| 696 | |
| 697 | if (is_win) { |
| 698 | sources += [ |
| 699 | "win32socketinit.cc", |
| 700 | "win32socketinit.h", |
| 701 | "win32socketserver.cc", |
| 702 | "win32socketserver.h", |
| 703 | ] |
| 704 | } |
| 705 | } # !build_with_chromium |
| 706 | |
| 707 | if (rtc_build_ssl) { |
| 708 | deps += [ "//third_party/boringssl" ] |
Dan Minor | 9cdd876 | 2018-01-16 10:40:39 -0500 | [diff] [blame] | 709 | } else { |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 710 | configs += [ ":external_ssl_library" ] |
| 711 | } |
| 712 | |
| 713 | if (is_android) { |
| 714 | sources += [ |
| 715 | "ifaddrs-android.cc", |
| 716 | "ifaddrs-android.h", |
| 717 | ] |
| 718 | |
| 719 | libs += [ |
| 720 | "log", |
| 721 | "GLESv2", |
| 722 | ] |
| 723 | } |
| 724 | |
| 725 | if (is_ios || is_mac) { |
mbonadei | 310e32b | 2017-09-07 07:36:28 -0700 | [diff] [blame] | 726 | sources += [ "macifaddrs_converter.cc" ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 727 | } |
| 728 | |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 729 | if (rtc_use_x11) { |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 730 | libs += [ |
| 731 | "dl", |
| 732 | "rt", |
| 733 | "Xext", |
| 734 | "X11", |
| 735 | "Xcomposite", |
| 736 | "Xrender", |
| 737 | ] |
| 738 | } |
| 739 | |
| 740 | if (is_linux) { |
| 741 | libs += [ |
| 742 | "dl", |
| 743 | "rt", |
| 744 | ] |
| 745 | } |
| 746 | |
| 747 | if (is_mac) { |
| 748 | sources += [ |
| 749 | "macutils.cc", |
| 750 | "macutils.h", |
| 751 | ] |
| 752 | libs += [ |
| 753 | # For ProcessInformationCopyDictionary in unixfilesystem.cc. |
| 754 | "ApplicationServices.framework", |
| 755 | ] |
| 756 | } |
| 757 | |
| 758 | if (is_win) { |
| 759 | sources += [ |
| 760 | "win32.cc", |
| 761 | "win32.h", |
| 762 | "win32filesystem.cc", |
| 763 | "win32filesystem.h", |
| 764 | "win32securityerrors.cc", |
| 765 | "win32window.cc", |
| 766 | "win32window.h", |
| 767 | ] |
| 768 | |
| 769 | libs += [ |
| 770 | "crypt32.lib", |
| 771 | "iphlpapi.lib", |
| 772 | "secur32.lib", |
| 773 | ] |
| 774 | |
| 775 | cflags += [ |
| 776 | # Suppress warnings about WIN32_LEAN_AND_MEAN. |
| 777 | "/wd4005", |
| 778 | "/wd4703", |
| 779 | ] |
| 780 | |
| 781 | defines += [ "_CRT_NONSTDC_NO_DEPRECATE" ] |
| 782 | } |
| 783 | |
| 784 | if (is_posix) { |
| 785 | sources += [ |
| 786 | "ifaddrs_converter.cc", |
| 787 | "ifaddrs_converter.h", |
| 788 | "unixfilesystem.cc", |
| 789 | "unixfilesystem.h", |
| 790 | ] |
| 791 | } |
| 792 | |
| 793 | if (is_nacl) { |
| 794 | deps += [ "//native_client_sdk/src/libraries/nacl_io" ] |
| 795 | defines += [ "timezone=_timezone" ] |
| 796 | sources -= [ "ifaddrs_converter.cc" ] |
| 797 | } |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 798 | } |
| 799 | |
| 800 | rtc_source_set("gtest_prod") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 801 | visibility = [ "*" ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 802 | sources = [ |
| 803 | "gtest_prod_util.h", |
| 804 | ] |
| 805 | } |
| 806 | |
| 807 | config("rtc_base_tests_utils_exported_config") { |
| 808 | defines = [ "GTEST_RELATIVE_PATH" ] |
| 809 | } |
| 810 | |
| 811 | config("rtc_base_tests_utils_warnings_config") { |
| 812 | if (is_win && is_clang) { |
| 813 | cflags = [ |
| 814 | # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6270 |
| 815 | "-Wno-reorder", |
| 816 | "-Wno-sign-compare", |
| 817 | ] |
| 818 | } |
| 819 | } |
| 820 | |
| 821 | rtc_source_set("rtc_base_tests_utils") { |
| 822 | testonly = true |
| 823 | sources = [ |
| 824 | # Also use this as a convenient dumping ground for misc files that are |
| 825 | # included by multiple targets below. |
| 826 | "cpu_time.cc", |
| 827 | "cpu_time.h", |
| 828 | "fakeclock.cc", |
| 829 | "fakeclock.h", |
| 830 | "fakenetwork.h", |
Steve Anton | 9de3aac | 2017-10-24 10:08:26 -0700 | [diff] [blame] | 831 | "fakesslidentity.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 832 | "fakesslidentity.h", |
| 833 | "firewallsocketserver.cc", |
| 834 | "firewallsocketserver.h", |
| 835 | "gunit.h", |
Niels Möller | 3c8a5f2 | 2017-12-15 16:04:21 +0100 | [diff] [blame] | 836 | "httpbase.cc", |
| 837 | "httpbase.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 838 | "httpserver.cc", |
| 839 | "httpserver.h", |
| 840 | "md5.cc", |
| 841 | "md5.h", |
| 842 | "md5digest.cc", |
| 843 | "md5digest.h", |
| 844 | "memory_usage.cc", |
| 845 | "memory_usage.h", |
| 846 | "natserver.cc", |
| 847 | "natserver.h", |
| 848 | "natsocketfactory.cc", |
| 849 | "natsocketfactory.h", |
| 850 | "nattypes.cc", |
| 851 | "nattypes.h", |
| 852 | "proxyserver.cc", |
| 853 | "proxyserver.h", |
Patrik Höglund | 563934e | 2017-09-15 09:04:28 +0200 | [diff] [blame] | 854 | "refcount.h", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 855 | "sha1.cc", |
| 856 | "sha1.h", |
| 857 | "sha1digest.cc", |
| 858 | "sha1digest.h", |
| 859 | "sigslottester.h", |
| 860 | "sigslottester.h.pump", |
| 861 | "testbase64.h", |
| 862 | "testclient.cc", |
| 863 | "testclient.h", |
Steve Anton | 9de3aac | 2017-10-24 10:08:26 -0700 | [diff] [blame] | 864 | "testechoserver.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 865 | "testechoserver.h", |
Steve Anton | 9de3aac | 2017-10-24 10:08:26 -0700 | [diff] [blame] | 866 | "testutils.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 867 | "testutils.h", |
| 868 | "timedelta.h", |
| 869 | "virtualsocketserver.cc", |
| 870 | "virtualsocketserver.h", |
| 871 | ] |
| 872 | configs += [ ":rtc_base_tests_utils_warnings_config" ] |
| 873 | public_configs = [ ":rtc_base_tests_utils_exported_config" ] |
| 874 | deps = [ |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 875 | ":checks", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 876 | ":rtc_base", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 877 | ":stringutils", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 878 | "../test:field_trial", |
| 879 | "../test:test_support", |
| 880 | ] |
| 881 | public_deps = [ |
| 882 | "//testing/gmock", |
| 883 | "//testing/gtest", |
| 884 | ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 885 | } |
| 886 | |
| 887 | if (rtc_include_tests) { |
| 888 | rtc_source_set("rtc_base_tests_main") { |
| 889 | testonly = true |
| 890 | sources = [ |
| 891 | "unittest_main.cc", |
| 892 | ] |
| 893 | public_configs = [ ":rtc_base_tests_utils_exported_config" ] |
| 894 | deps = [ |
| 895 | ":rtc_base", |
| 896 | ":rtc_base_approved", |
| 897 | ":rtc_base_tests_utils", |
| 898 | "../test:field_trial", |
| 899 | "../test:test_support", |
| 900 | ] |
| 901 | |
| 902 | public_deps = [ |
| 903 | "//testing/gmock", |
| 904 | "//testing/gtest", |
| 905 | ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 906 | } |
| 907 | |
| 908 | rtc_source_set("rtc_base_nonparallel_tests") { |
| 909 | testonly = true |
| 910 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 911 | sources = [ |
| 912 | "cpu_time_unittest.cc", |
| 913 | "filerotatingstream_unittest.cc", |
| 914 | "nullsocketserver_unittest.cc", |
| 915 | "physicalsocketserver_unittest.cc", |
| 916 | "socket_unittest.cc", |
| 917 | "socket_unittest.h", |
| 918 | "socketaddress_unittest.cc", |
| 919 | ] |
| 920 | deps = [ |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 921 | ":checks", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 922 | ":rtc_base", |
| 923 | ":rtc_base_tests_main", |
| 924 | ":rtc_base_tests_utils", |
| 925 | "../system_wrappers:system_wrappers", |
| 926 | "../test:test_support", |
| 927 | "//testing/gtest", |
| 928 | ] |
| 929 | if (is_win) { |
| 930 | sources += [ "win32socketserver_unittest.cc" ] |
| 931 | } |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 932 | } |
| 933 | |
| 934 | rtc_source_set("rtc_base_approved_unittests") { |
| 935 | testonly = true |
| 936 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 937 | sources = [ |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 938 | "atomicops_unittest.cc", |
| 939 | "base64_unittest.cc", |
| 940 | "basictypes_unittest.cc", |
| 941 | "bind_unittest.cc", |
| 942 | "bitbuffer_unittest.cc", |
Alex Narest | d0e196b | 2017-11-22 17:22:35 +0100 | [diff] [blame] | 943 | "bitrateallocationstrategy_unittest.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 944 | "buffer_unittest.cc", |
| 945 | "bufferqueue_unittest.cc", |
| 946 | "bytebuffer_unittest.cc", |
| 947 | "byteorder_unittest.cc", |
| 948 | "copyonwritebuffer_unittest.cc", |
| 949 | "criticalsection_unittest.cc", |
| 950 | "event_tracer_unittest.cc", |
| 951 | "event_unittest.cc", |
| 952 | "file_unittest.cc", |
| 953 | "function_view_unittest.cc", |
| 954 | "logging_unittest.cc", |
| 955 | "md5digest_unittest.cc", |
Karl Wiberg | 65c3922 | 2017-11-22 12:25:14 +0100 | [diff] [blame] | 956 | "numerics/histogram_percentile_counter_unittest.cc", |
| 957 | "numerics/mod_ops_unittest.cc", |
| 958 | "numerics/moving_max_counter_unittest.cc", |
Karl Wiberg | e40468b | 2017-11-22 10:42:26 +0100 | [diff] [blame] | 959 | "numerics/safe_compare_unittest.cc", |
| 960 | "numerics/safe_minmax_unittest.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 961 | "onetimeevent_unittest.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 962 | "pathutils_unittest.cc", |
| 963 | "platform_thread_unittest.cc", |
| 964 | "random_unittest.cc", |
| 965 | "rate_limiter_unittest.cc", |
| 966 | "rate_statistics_unittest.cc", |
| 967 | "ratetracker_unittest.cc", |
| 968 | "refcountedobject_unittest.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 969 | "string_to_number_unittest.cc", |
| 970 | "stringencode_unittest.cc", |
| 971 | "stringize_macros_unittest.cc", |
| 972 | "stringutils_unittest.cc", |
| 973 | "swap_queue_unittest.cc", |
| 974 | "thread_annotations_unittest.cc", |
| 975 | "thread_checker_unittest.cc", |
| 976 | "timestampaligner_unittest.cc", |
| 977 | "timeutils_unittest.cc", |
| 978 | "virtualsocket_unittest.cc", |
| 979 | ] |
| 980 | deps = [ |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 981 | ":checks", |
| 982 | ":rate_limiter", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 983 | ":rtc_base", |
| 984 | ":rtc_base_approved", |
| 985 | ":rtc_base_tests_main", |
| 986 | ":rtc_base_tests_utils", |
| 987 | ":rtc_task_queue", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 988 | ":safe_compare", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 989 | ":stringutils", |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame] | 990 | "../api:array_view", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 991 | "../system_wrappers:system_wrappers", |
| 992 | "../test:test_support", |
| 993 | ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 994 | } |
| 995 | |
| 996 | rtc_source_set("rtc_task_queue_unittests") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 997 | visibility = [ "*" ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 998 | testonly = true |
| 999 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1000 | sources = [ |
| 1001 | "task_queue_unittest.cc", |
| 1002 | ] |
| 1003 | deps = [ |
mbonadei | 95c8f65 | 2017-08-27 23:40:10 -0700 | [diff] [blame] | 1004 | ":rtc_base_approved", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1005 | ":rtc_base_tests_main", |
| 1006 | ":rtc_base_tests_utils", |
| 1007 | ":rtc_task_queue", |
| 1008 | "../test:test_support", |
| 1009 | ] |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1010 | } |
| 1011 | |
| 1012 | rtc_source_set("sequenced_task_checker_unittests") { |
| 1013 | testonly = true |
| 1014 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1015 | sources = [ |
| 1016 | "sequenced_task_checker_unittest.cc", |
| 1017 | ] |
| 1018 | deps = [ |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 1019 | ":checks", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1020 | ":rtc_base_approved", |
| 1021 | ":rtc_base_tests_main", |
| 1022 | ":rtc_task_queue", |
| 1023 | ":sequenced_task_checker", |
| 1024 | "../test:test_support", |
| 1025 | ] |
| 1026 | } |
| 1027 | |
| 1028 | rtc_source_set("weak_ptr_unittests") { |
| 1029 | testonly = true |
| 1030 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1031 | sources = [ |
| 1032 | "weak_ptr_unittest.cc", |
| 1033 | ] |
| 1034 | deps = [ |
Tommi | 897e136 | 2017-12-01 18:56:43 +0100 | [diff] [blame] | 1035 | ":rtc_base_approved_generic", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1036 | ":rtc_base_tests_main", |
| 1037 | ":rtc_base_tests_utils", |
| 1038 | ":rtc_task_queue", |
| 1039 | ":weak_ptr", |
| 1040 | "../test:test_support", |
| 1041 | ] |
| 1042 | } |
| 1043 | |
| 1044 | rtc_source_set("rtc_numerics_unittests") { |
| 1045 | testonly = true |
| 1046 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1047 | sources = [ |
| 1048 | "numerics/exp_filter_unittest.cc", |
Ilya Nikolaevskiy | b968575 | 2017-11-01 14:01:00 +0100 | [diff] [blame] | 1049 | "numerics/moving_median_filter_unittest.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1050 | "numerics/percentile_filter_unittest.cc", |
Bjorn Terelius | a194e58 | 2017-10-25 13:07:09 +0200 | [diff] [blame] | 1051 | "numerics/sequence_number_util_unittest.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1052 | ] |
| 1053 | deps = [ |
| 1054 | ":rtc_base_approved", |
| 1055 | ":rtc_base_tests_main", |
| 1056 | ":rtc_numerics", |
| 1057 | "../test:test_support", |
| 1058 | ] |
| 1059 | } |
| 1060 | |
| 1061 | config("rtc_base_unittests_config") { |
| 1062 | if (is_clang) { |
| 1063 | cflags = [ "-Wno-unused-const-variable" ] |
| 1064 | } |
| 1065 | } |
| 1066 | rtc_source_set("rtc_base_unittests") { |
| 1067 | testonly = true |
| 1068 | |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1069 | sources = [ |
| 1070 | "callback_unittest.cc", |
| 1071 | "crc32_unittest.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1072 | "helpers_unittest.cc", |
| 1073 | "httpbase_unittest.cc", |
| 1074 | "httpcommon_unittest.cc", |
| 1075 | "httpserver_unittest.cc", |
| 1076 | "ipaddress_unittest.cc", |
| 1077 | "memory_usage_unittest.cc", |
| 1078 | "messagedigest_unittest.cc", |
| 1079 | "messagequeue_unittest.cc", |
| 1080 | "nat_unittest.cc", |
| 1081 | "network_unittest.cc", |
| 1082 | "optionsfile_unittest.cc", |
| 1083 | "proxy_unittest.cc", |
| 1084 | "ptr_util_unittest.cc", |
| 1085 | "ratelimiter_unittest.cc", |
| 1086 | "rollingaccumulator_unittest.cc", |
| 1087 | "rtccertificate_unittest.cc", |
| 1088 | "rtccertificategenerator_unittest.cc", |
| 1089 | "sha1digest_unittest.cc", |
deadbeef | 8290ddf | 2017-07-11 16:56:05 -0700 | [diff] [blame] | 1090 | "signalthread_unittest.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1091 | "sigslot_unittest.cc", |
| 1092 | "sigslottester_unittest.cc", |
| 1093 | "stream_unittest.cc", |
| 1094 | "testclient_unittest.cc", |
| 1095 | "thread_unittest.cc", |
Joachim Bauch | 58daf40 | 2017-12-21 22:00:34 +0100 | [diff] [blame] | 1096 | "zero_memory_unittest.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1097 | ] |
| 1098 | if (is_win) { |
| 1099 | sources += [ |
| 1100 | "win32_unittest.cc", |
| 1101 | "win32window_unittest.cc", |
| 1102 | ] |
| 1103 | } |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1104 | if (is_posix) { |
| 1105 | sources += [ |
Diogo Real | 1dca9d5 | 2017-08-29 12:18:32 -0700 | [diff] [blame] | 1106 | "openssladapter_unittest.cc", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1107 | "ssladapter_unittest.cc", |
| 1108 | "sslidentity_unittest.cc", |
| 1109 | "sslstreamadapter_unittest.cc", |
| 1110 | ] |
| 1111 | } |
| 1112 | deps = [ |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 1113 | ":checks", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1114 | ":rtc_base_tests_main", |
| 1115 | ":rtc_base_tests_utils", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 1116 | ":stringutils", |
Joachim Bauch | 58daf40 | 2017-12-21 22:00:34 +0100 | [diff] [blame] | 1117 | "../api:array_view", |
kwiberg | 84f6a3f | 2017-09-05 08:43:13 -0700 | [diff] [blame] | 1118 | "../api:optional", |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1119 | "../test:test_support", |
| 1120 | ] |
| 1121 | public_deps = [ |
| 1122 | ":rtc_base", |
| 1123 | ] |
| 1124 | configs += [ ":rtc_base_unittests_config" ] |
Diogo Real | 1dca9d5 | 2017-08-29 12:18:32 -0700 | [diff] [blame] | 1125 | if (build_with_chromium) { |
| 1126 | include_dirs = [ "../../boringssl/src/include" ] |
| 1127 | } |
| 1128 | if (rtc_build_ssl) { |
| 1129 | deps += [ "//third_party/boringssl" ] |
| 1130 | } else { |
| 1131 | configs += [ ":external_ssl_library" ] |
| 1132 | } |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1133 | } |
| 1134 | } |
| 1135 | |
Henrik Kjellander | 73e2180 | 2017-06-20 08:38:58 +0200 | [diff] [blame] | 1136 | if (is_android) { |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 1137 | rtc_android_library("base_java") { |
Henrik Kjellander | c036276 | 2017-06-29 08:03:04 +0200 | [diff] [blame] | 1138 | java_files = [ |
| 1139 | "java/src/org/webrtc/ContextUtils.java", |
| 1140 | "java/src/org/webrtc/Logging.java", |
| 1141 | "java/src/org/webrtc/Size.java", |
| 1142 | "java/src/org/webrtc/ThreadUtils.java", |
| 1143 | ] |
Henrik Kjellander | 73e2180 | 2017-06-20 08:38:58 +0200 | [diff] [blame] | 1144 | } |
| 1145 | } |