1# Copyright (C) 2017 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")
16
17source_set("lib") {
18  testonly = true
19  deps = [
20    "../../gn:default_deps",
21    "../../gn:protobuf_full_deps",
22    "../../protos/perfetto/trace:lite",
23  ]
24  sources = [
25    "ftrace_event_formatter.cc",
26    "ftrace_event_formatter.h",
27    "ftrace_inode_handler.cc",
28    "ftrace_inode_handler.h",
29    "main.cc",
30  ]
31}
32
33if (current_toolchain == host_toolchain) {
34  executable("trace_to_text_host") {
35    testonly = true
36    deps = [
37      ":lib",
38      "../../gn:default_deps",
39    ]
40  }
41}
42
43# The one for the android tree is defined in the top-level BUILD.gn.
44if (!build_with_android) {
45  copy("trace_to_text") {
46    testonly = true
47    host_out_dir_ =
48        get_label_info(":trace_to_text_host($host_toolchain)", "root_out_dir")
49    deps = [
50      ":trace_to_text_host($host_toolchain)",
51    ]
52    sources = [
53      "${host_out_dir_}/trace_to_text_host",
54    ]
55    outputs = [
56      "${root_out_dir}/trace_to_text",
57    ]
58  }
59}
60