# 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/test.gni")

if (enable_perfetto_trace_processor_sqlite) {
  source_set("sqlite") {
    sources = [
      "db_sqlite_table.cc",
      "db_sqlite_table.h",
      "query_cache.h",
      "span_join_operator_table.cc",
      "span_join_operator_table.h",
      "sql_stats_table.cc",
      "sql_stats_table.h",
      "sqlite_raw_table.cc",
      "sqlite_raw_table.h",
      "sqlite_utils.cc",
      "sqlite_utils.h",
      "stats_table.cc",
      "stats_table.h",
      "window_operator_table.cc",
      "window_operator_table.h",
    ]
    deps = [
      "..:ftrace_descriptors",
      "..:metatrace",
      "../../../gn:default_deps",
      "../../../gn:sqlite",
      "../../../protos/perfetto/trace/ftrace:zero",
      "../../base",
      "../containers",
      "../db",
      "../dynamic",
      "../importers/common",
      "../storage",
      "../types",
      "../util",
      "../util:profile_builder",
    ]
    public_deps = [ ":sqlite_minimal" ]
  }

  source_set("sqlite_minimal") {
    sources = [
      "query_constraints.cc",
      "query_constraints.h",
      "scoped_db.h",
      "sqlite_table.cc",
      "sqlite_table.h",
      "sqlite_utils.h",
    ]
    deps = [
      "..:metatrace",
      "../../../gn:default_deps",
      "../../../gn:sqlite",
      "../../../include/perfetto/trace_processor",
      "../../base",
    ]
  }

  perfetto_unittest_source_set("unittests") {
    testonly = true
    sources = [
      "db_sqlite_table_unittest.cc",
      "query_constraints_unittest.cc",
      "span_join_operator_table_unittest.cc",
      "sqlite_utils_unittest.cc",
    ]
    deps = [
      ":sqlite",
      ":sqlite_minimal",
      "../../../gn:default_deps",
      "../../../gn:gtest_and_gmock",
      "../../../gn:sqlite",
      "../../base",
    ]
  }

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