blob: 827b57abad67eebed2dae5b9dd652a218842064e [file] [log] [blame]
btolsch9d6900c2018-05-30 18:22:53 -07001# Copyright 2018 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Yuri Wiitalab2d13232019-02-04 18:07:28 -08005import("//build_overrides/build.gni")
btolsch5292c942018-07-26 00:06:22 -07006
Yuri Wiitalab2d13232019-02-04 18:07:28 -08007source_set("platform") {
Yuri Wiitalab2d13232019-02-04 18:07:28 -08008 sources = [
Yuri Wiitalab2d13232019-02-04 18:07:28 -08009 "api/event_waiter.cc",
10 "api/event_waiter.h",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080011 "api/logging.h",
Jordan Baylesad2d2cd2019-05-22 14:49:40 -070012 "api/logging_util.cc",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080013 "api/network_interface.cc",
14 "api/network_interface.h",
btolsch4051e722019-06-07 16:15:17 -070015 "api/network_runner.cc",
16 "api/network_runner.h",
17 "api/socket.h",
Jordan Baylesb0c191e2019-03-26 15:49:57 -070018 "api/task_runner.h",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080019 "api/time.h",
Jordan Baylesa5ac5c82019-05-22 14:49:40 -070020 "api/tls_socket.h",
21 "api/tls_socket_creds.h",
Ryan Keanedeb48b32019-06-28 16:24:40 -070022 "api/udp_socket.cc",
Jordan Baylesad2d2cd2019-05-22 14:49:40 -070023 "api/udp_socket.h",
btolsch4051e722019-06-07 16:15:17 -070024 "api/upd_callbacks.h",
Jordan Baylesb9262f42019-05-30 14:10:02 -070025 "base/ssl_context.cc",
26 "base/ssl_context.h",
btolsch2f2e7fa2019-03-29 16:48:49 -070027 "base/time.cc",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080028 ]
Jordan Bayles9eb09742019-01-15 14:04:52 -080029
30 public_deps = [
Jordan Baylesf1e4bb72019-05-01 12:38:39 -070031 "../osp_base",
btolsch2f2e7fa2019-03-29 16:48:49 -070032 "../third_party/abseil",
Jordan Baylesb9262f42019-05-30 14:10:02 -070033 "../third_party/boringssl",
Jordan Bayles9eb09742019-01-15 14:04:52 -080034 ]
Jordan Bayles9ade4152019-05-08 17:03:24 -070035
Jordan Baylesf1e4bb72019-05-01 12:38:39 -070036 allow_circular_includes_from = [ "../osp_base" ]
Jordan Bayles9ade4152019-05-08 17:03:24 -070037
Jordan Baylesa80724b2019-05-02 17:17:26 -070038 configs += [ "../build:allow_build_from_embedder" ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080039
Jordan Baylesa80724b2019-05-02 17:17:26 -070040 if (!build_with_chromium) {
btolschc92ba2f2019-04-10 11:46:01 -070041 sources += [
btolsch4666ed22019-04-25 15:58:07 -070042 "base/event_loop.cc",
43 "base/event_loop.h",
btolschc92ba2f2019-04-10 11:46:01 -070044 "base/task_runner_impl.cc",
45 "base/task_runner_impl.h",
46 ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080047
48 if (is_linux) {
49 sources += [ "linux/network_interface.cc" ]
50 } else if (is_mac) {
Jordan Baylesa80724b2019-05-02 17:17:26 -070051 defines = [
Yuri Wiitalab2d13232019-02-04 18:07:28 -080052 # Required, to use the new IPv6 Sockets options introduced by RFC 3542.
53 "__APPLE_USE_RFC_3542",
54 ]
Jordan Bayles9ade4152019-05-08 17:03:24 -070055
Yuri Wiitalab2d13232019-02-04 18:07:28 -080056 sources += [ "mac/network_interface.cc" ]
57 }
58
59 if (is_posix) {
60 sources += [
Yuri Wiitalab2d13232019-02-04 18:07:28 -080061 "posix/event_waiter.cc",
Jordan Baylesad2d2cd2019-05-22 14:49:40 -070062 "posix/udp_socket.cc",
63 "posix/udp_socket.h",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080064 ]
65 }
Jordan Bayles9ade4152019-05-08 17:03:24 -070066
67 deps = [
Jordan Baylesad2d2cd2019-05-22 14:49:40 -070068 ":default_logger",
Jordan Bayles9ade4152019-05-08 17:03:24 -070069 ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080070 }
btolsch9d6900c2018-05-30 18:22:53 -070071}
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -070072
Jordan Baylesaa021ce2019-05-29 13:57:44 -070073source_set("test") {
74 testonly = true
75 sources = [
76 "test/fake_clock.cc",
77 "test/fake_clock.h",
Yuri Wiitalaec353612019-06-18 17:32:39 -070078 "test/fake_task_runner.cc",
79 "test/fake_task_runner.h",
Ryan Keanedeb48b32019-06-28 16:24:40 -070080 "test/mock_udp_socket.cc",
81 "test/mock_udp_socket.h",
Jordan Baylesaa021ce2019-05-29 13:57:44 -070082 ]
83
Jordan Bayles7bc7f102019-05-30 12:38:43 -070084 configs += [ "../build:allow_build_from_embedder" ]
85
Jordan Baylesaa021ce2019-05-29 13:57:44 -070086 deps = [
87 ":platform",
Ryan Keanedeb48b32019-06-28 16:24:40 -070088 "../third_party/googletest:gmock",
Jordan Baylesaa021ce2019-05-29 13:57:44 -070089 ]
90}
91
Jordan Bayles9ade4152019-05-08 17:03:24 -070092source_set("default_logger") {
93 sources = [
94 "base/logging.cc",
95 ]
96
97 if (is_posix) {
Jordan Baylesad2d2cd2019-05-22 14:49:40 -070098 sources += [ "posix/log_initializer.cc" ]
Jordan Bayles9ade4152019-05-08 17:03:24 -070099 }
100
101 configs += [ "../build:allow_build_from_embedder" ]
102
103 deps = [
104 "../osp_base",
105 "../third_party/abseil",
106 ]
107}
108
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -0700109source_set("platform_unittests") {
110 testonly = true
111
112 sources = [
113 "api/time_unittest.cc",
Ryan Keanedeb48b32019-06-28 16:24:40 -0700114 "api/udp_socket_unittest.cc",
Jordan Baylesb9262f42019-05-30 14:10:02 -0700115 "base/ssl_context_unittest.cc",
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -0700116 ]
117
118 # The unit tests in base/ assume the standalone implementation is being used.
119 # Exclude them if an embedder is providing the implementation.
120 if (!build_with_chromium) {
btolschc92ba2f2019-04-10 11:46:01 -0700121 sources += [
btolsch4051e722019-06-07 16:15:17 -0700122 "base/task_runner_impl_unittest.cc",
btolschc92ba2f2019-04-10 11:46:01 -0700123 "base/time_unittest.cc",
124 ]
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -0700125 }
126
127 deps = [
128 ":platform",
Ryan Keanedeb48b32019-06-28 16:24:40 -0700129 "../third_party/googletest:gmock",
btolsch4666ed22019-04-25 15:58:07 -0700130 "../third_party/googletest:gtest",
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -0700131 ]
Jordan Bayles9ade4152019-05-08 17:03:24 -0700132
133 configs += [ "../build:allow_build_from_embedder" ]
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -0700134}