xref: /aosp_15_r20/external/openscreen/BUILD.gn (revision 3f982cf4871df8771c9d4abe6e9a6f8d829b2736)
1# 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
5import("//build_overrides/build.gni")
6import("osp/build/config/services.gni")
7
8# All compilable non-test targets in the repository (both executables and
9# source_sets).
10group("gn_all") {
11  deps = [
12    "cast/common:certificate",
13    "cast/common:channel",
14    "cast/common:public",
15    "cast/receiver:channel",
16    "cast/sender:channel",
17    "cast/streaming:receiver",
18    "cast/streaming:sender",
19    "discovery:dnssd",
20    "discovery:mdns",
21    "discovery:public",
22    "platform",
23    "third_party/abseil",
24    "third_party/boringssl",
25    "third_party/jsoncpp",
26    "third_party/mozilla",
27    "third_party/tinycbor",
28    "tools/cddl($host_toolchain)",
29    "util",
30  ]
31
32  # Mac OS X 10.15 is incompatible with the current version of QUIC.
33  if (!is_mac) {
34    deps += [
35      "osp",
36      "osp/msgs",
37    ]
38
39    if (use_chromium_quic) {
40      deps += [
41        "third_party/chromium_quic",
42        "third_party/chromium_quic:quic_demo_server",
43        "third_party/chromium_quic:quic_streaming_playback_controller",
44      ]
45    }
46
47    if (use_chromium_quic) {
48      deps += [ "osp:osp_demo" ]
49    }
50  }
51
52  if (!build_with_chromium) {
53    deps += [
54      "cast/standalone_receiver:cast_receiver",
55      "cast/standalone_sender:cast_sender",
56      "third_party/protobuf:protoc($host_toolchain)",
57      "third_party/zlib",
58    ]
59  } else {
60    if (!is_mac) {
61      deps += [ "cast/cast_core/api" ]
62    }
63  }
64}
65
66source_set("openscreen_unittests_all") {
67  testonly = true
68  public_deps = [
69    "cast/common:unittests",
70    "cast/receiver:unittests",
71    "cast/sender:unittests",
72    "cast/streaming:unittests",
73    "cast/test:unittests",
74    "platform:unittests",
75    "third_party/abseil",
76    "util:unittests",
77  ]
78
79  if (!build_with_chromium && is_posix) {
80    public_deps += [
81      "cast/test:make_crl_tests($host_toolchain)",
82
83      # TODO(crbug.com/1132604): Discovery unittests fail in Chrome.
84      "discovery:unittests",
85    ]
86  }
87
88  if (!is_mac) {
89    public_deps += [
90      "osp:unittests",
91      "osp/msgs:unittests",
92    ]
93  }
94}
95
96if (!build_with_chromium) {
97  executable("openscreen_unittests") {
98    testonly = true
99    deps = [
100      ":openscreen_unittests_all",
101      "test:test_main",
102    ]
103  }
104}
105
106if (!build_with_chromium && is_posix) {
107  source_set("e2e_tests_all") {
108    testonly = true
109    public_deps = [
110      "cast/common:discovery_e2e_test",
111      "cast/test:e2e_tests",
112      "cast/test:make_crl_tests($host_toolchain)",
113    ]
114  }
115
116  executable("e2e_tests") {
117    testonly = true
118    deps = [
119      ":e2e_tests_all",
120      "test:test_main",
121    ]
122  }
123}
124
125if (!build_with_chromium) {
126  source_set("fuzzer_tests_all") {
127    testonly = true
128    deps = [
129      "//cast/common:message_framer_fuzzer",
130      "//cast/streaming:compound_rtcp_parser_fuzzer",
131      "//cast/streaming:rtp_packet_parser_fuzzer",
132      "//cast/streaming:sender_report_parser_fuzzer",
133      "//discovery:mdns_fuzzer",
134    ]
135  }
136}
137