# 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",
    "memory_tables.py",
    "metadata_tables.py",
    "profiler_tables.py",
    "sched_tables.py",
    "slice_tables.py",
    "trace_proto_tables.py",
    "track_tables.py",
    "winscope_tables.py",
  ]
  generate_docs = true
}

source_set("tables") {
  sources = [
    "macros_internal.h",
    "table_destructors.cc",
  ]
  deps = [
    "../../../gn:default_deps",
    "../../../include/perfetto/ext/base",
    "../db",
  ]
  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",
    "../db",
  ]
}

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