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 "default_socket.cc", 31 "memfd.cc", 32 "memfd.h", 33 "posix_shared_memory.cc", 34 "posix_shared_memory.h", 35 ] 36 deps = [ 37 "../../../gn:default_deps", 38 "../../../include/perfetto/ext/ipc", 39 "../../base", 40 "../core", 41 ] 42} 43 44perfetto_unittest_source_set("unittests") { 45 testonly = true 46 deps = [ 47 ":common", 48 "../../../gn:default_deps", 49 "../../../gn:gtest_and_gmock", 50 "../../../include/perfetto/ext/ipc", 51 "../../base", 52 "../../base:test_support", 53 ] 54 sources = [ "posix_shared_memory_unittest.cc" ] 55} 56