# 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")

source_set("minimal") {
  sources = [
    "base_id.h",
    "column.cc",
    "column.h",
    "column_storage.cc",
    "column_storage.h",
    "column_storage_overlay.h",
    "compare.h",
    "query_executor.cc",
    "query_executor.h",
    "table.cc",
    "table.h",
    "typed_column.h",
    "typed_column_internal.h",
  ]
  deps = [
    "../../../gn:default_deps",
    "../../../include/perfetto/trace_processor",
    "../../base",
    "../containers",
    "../util:glob",
    "../util:regex",
    "../util:util",
    "column:minimal",
  ]
}

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

source_set("compare") {
  sources = [ "compare.h" ]
  deps = [
    "../../../include/perfetto/trace_processor",
    "../containers",
  ]
}

perfetto_unittest_source_set("unittests") {
  testonly = true
  sources = [
    "column_storage_overlay_unittest.cc",
    "compare_unittest.cc",
    "query_executor_unittest.cc",
    "runtime_table_unittest.cc",
  ]
  deps = [
    ":db",
    "../../../gn:default_deps",
    "../../../gn:gtest_and_gmock",
    "../../../include/perfetto/trace_processor:basic_types",
    "../../base",
    "../../base:test_support",
    "../containers",
    "../tables",
    "column",
    "column:fake_storage",
  ]
}

if (enable_perfetto_benchmarks) {
  source_set("benchmarks") {
    testonly = true
    deps = [
      ":db",
      "../../../gn:benchmark",
      "../../../gn:default_deps",
      "../../../include/perfetto/base",
      "../../../include/perfetto/ext/base",
      "../../../include/perfetto/trace_processor:basic_types",
      "../../base:test_support",
      "../containers",
      "../tables:tables_python",
    ]
    sources = [
      "column_storage_overlay_benchmark.cc",
      "query_executor_benchmark.cc",
    ]
  }
}
