# 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 = [
      "create_function.cc",
      "create_function.h",
      "create_function_internal.cc",
      "create_function_internal.h",
      "create_view_function.cc",
      "create_view_function.h",
      "db_sqlite_table.cc",
      "db_sqlite_table.h",
      "query_cache.h",
      "register_function.cc",
      "register_function.h",
      "span_join_operator_table.cc",
      "span_join_operator_table.h",
      "sql_stats_table.cc",
      "sql_stats_table.h",
      "sqlite3_str_split.cc",
      "sqlite3_str_split.h",
      "sqlite_raw_table.cc",
      "sqlite_raw_table.h",
      "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",
    ]
    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 = [
      "../../../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",
      "sqlite3_str_split_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" ]
    }
  }
}
