blob: fdd5f1b4bdc69aa55d12182b17d5bf6f19574fe6 [file] [log] [blame]
Lalit Maganti26f69bd2019-04-29 18:23:47 +01001# Copyright (C) 2018 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
Lalit Maganti7177c7f2019-04-30 15:54:51 +010017sql_files = [
18 "android/android_mem.sql",
19 "android/android_mem_lmk.sql",
20]
Lalit Maganti26f69bd2019-04-29 18:23:47 +010021
22config("gen_config") {
23 include_dirs = [ "${root_gen_dir}/${perfetto_root_path}" ]
24}
25
26action("gen_merged_sql_metrics") {
27 script = "../../../tools/gen_merged_sql_metrics"
28 generated_header = "${target_gen_dir}/sql_metrics.h"
29 args = rebase_path(sql_files, root_build_dir) + [
30 "--cpp_out",
31 rebase_path(generated_header, root_build_dir),
32 ]
33 inputs = sql_files
34 outputs = [
35 generated_header,
36 ]
37 public_configs = [ ":gen_config" ]
38}
Lalit Maganti622676a2019-04-30 14:15:37 +010039
40source_set("lib") {
41 sources = [
42 "metrics.cc",
43 "metrics.h",
44 ]
45 deps = [
46 ":gen_merged_sql_metrics",
Lalit Maganti7177c7f2019-04-30 15:54:51 +010047 "../../../buildtools:sqlite",
Lalit Maganti622676a2019-04-30 14:15:37 +010048 "../../../gn:default_deps",
49 "../../../include/perfetto/trace_processor",
50 "../../../protos/perfetto/metrics:zero",
51 "../../../protos/perfetto/metrics/android:zero",
52 "../../protozero:protozero",
53 ]
54}