xref: /aosp_15_r20/external/perfetto/src/tracing/ipc/BUILD.gn (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1# Copyright (C) 2020 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import("../../../gn/perfetto.gni")
16import("../../../gn/test.gni")
17
18assert(enable_perfetto_ipc)
19
20# The lack of a default "ipc" target is deliberate. Clients need to explicitly
21# depend on ipc/{producer, consumer, service}. This is to avoid binary bloat
22# by always linking everything.
23
24source_set("common") {
25  public_deps = [
26    "../../../include/perfetto/ext/tracing/core",
27    "../../../include/perfetto/ext/tracing/ipc",
28  ]
29  sources = [
30    "memfd.cc",
31    "memfd.h",
32    "posix_shared_memory.cc",
33    "posix_shared_memory.h",
34    "shared_memory_windows.cc",
35    "shared_memory_windows.h",
36  ]
37  deps = [
38    ":default_socket",
39    "../../../gn:default_deps",
40    "../../../include/perfetto/ext/ipc",
41    "../../base",
42    "../core",
43  ]
44}
45
46source_set("default_socket") {
47  sources = [ "default_socket.cc" ]
48  public_deps = [ "../../../include/perfetto/tracing" ]
49  deps = [
50    "../../../gn:default_deps",
51    "../../../include/perfetto/ext/ipc",
52    "../../../include/perfetto/ext/tracing/core",
53    "../../../include/perfetto/tracing",
54    "../../base",
55  ]
56}
57
58perfetto_unittest_source_set("unittests") {
59  testonly = true
60  deps = [
61    ":common",
62    "../../../gn:default_deps",
63    "../../../gn:gtest_and_gmock",
64    "../../../include/perfetto/ext/ipc",
65    "../../base",
66    "../../base:test_support",
67  ]
68  sources = [ "posix_shared_memory_unittest.cc" ]
69}
70