Lalit Maganti | 26f69bd | 2019-04-29 18:23:47 +0100 | [diff] [blame] | 1 | # 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 | |
| 15 | import("../../../gn/perfetto.gni") |
| 16 | |
Lalit Maganti | 7177c7f | 2019-04-30 15:54:51 +0100 | [diff] [blame^] | 17 | sql_files = [ |
| 18 | "android/android_mem.sql", |
| 19 | "android/android_mem_lmk.sql", |
| 20 | ] |
Lalit Maganti | 26f69bd | 2019-04-29 18:23:47 +0100 | [diff] [blame] | 21 | |
| 22 | config("gen_config") { |
| 23 | include_dirs = [ "${root_gen_dir}/${perfetto_root_path}" ] |
| 24 | } |
| 25 | |
| 26 | action("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 Maganti | 622676a | 2019-04-30 14:15:37 +0100 | [diff] [blame] | 39 | |
| 40 | source_set("lib") { |
| 41 | sources = [ |
| 42 | "metrics.cc", |
| 43 | "metrics.h", |
| 44 | ] |
| 45 | deps = [ |
| 46 | ":gen_merged_sql_metrics", |
Lalit Maganti | 7177c7f | 2019-04-30 15:54:51 +0100 | [diff] [blame^] | 47 | "../../../buildtools:sqlite", |
Lalit Maganti | 622676a | 2019-04-30 14:15:37 +0100 | [diff] [blame] | 48 | "../../../gn:default_deps", |
| 49 | "../../../include/perfetto/trace_processor", |
| 50 | "../../../protos/perfetto/metrics:zero", |
| 51 | "../../../protos/perfetto/metrics/android:zero", |
| 52 | "../../protozero:protozero", |
| 53 | ] |
| 54 | } |