# Copyright (C) 2019 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("../../../gn/perfetto_tp_tables.gni")
import("../../../gn/test.gni")

perfetto_tp_tables("tables_python") {
  sources = [
    "android_tables.py",
    "counter_tables.py",
    "flow_tables.py",
    "jit_tables.py",
    "memory_tables.py",
    "metadata_tables.py",
    "perf_tables.py",
    "profiler_tables.py",
    "sched_tables.py",
    "slice_tables.py",
    "trace_proto_tables.py",
    "track_tables.py",
    "v8_tables.py",
    "winscope_tables.py",
  ]
  generate_docs = true
}

source_set("tables") {
  sources = [
    "macros_internal.cc",
    "macros_internal.h",
    "table_destructors.cc",
  ]
  deps = [
    "../../../gn:default_deps",
    "../../../include/perfetto/ext/base",
    "../../../include/perfetto/trace_processor",
    "../containers",
    "../db:minimal",
    "../db/column",
  ]
  public_deps = [ ":tables_python" ]
}

perfetto_tp_tables("py_tables_unittest") {
  sources = [ "py_tables_unittest.py" ]
}

source_set("unittests") {
  testonly = true
  sources = [ "py_tables_unittest.cc" ]
  deps = [
    ":py_tables_unittest",
    ":tables",
    "../../../gn:default_deps",
    "../../../gn:gtest_and_gmock",
    "../containers",
    "../db",
    "../db/column",
  ]
}

if (enable_perfetto_benchmarks) {
  source_set("benchmarks") {
    testonly = true
    deps = [
      ":py_tables_benchmark",
      "../../../gn:benchmark",
      "../../../gn:default_deps",
      "../../../include/perfetto/trace_processor",
      "../containers",
      "../db",
      "../db/column",
    ]
    sources = [ "py_tables_benchmark.cc" ]
  }
  perfetto_tp_tables("py_tables_benchmark") {
    sources = [ "py_tables_benchmark.py" ]
  }
}
