# Copyright (C) 2017 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("perfetto.gni")
import("proto_library.gni")

if (perfetto_root_path == "//") {
  import("//gn/standalone/sanitizers/vars.gni")
} else {
  import("//build/config/sanitizers/sanitizers.gni")
}

# Genereates a header files that contains a macro definition for each build flag
# that is required by the codebase. This is to avoid sprinkling cflags all over
# the places, which is very fragile especially for our codebase that needs to
# deal with several build systems.
# The way this works is the following:
# - This rule generates a header that contains a bunch of lines like:
#   #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ANDROID_BUILD()
# - The generated header is included by base/build_config.h
# - Source files in the codebase #include base/build_config and use the
#   pattern #if PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
buildflag_gen_dir_ = "$root_gen_dir/$perfetto_root_path/build_config"
action("gen_buildflags") {
  script = "write_buildflag_header.py"
  gen_header_path = "$buildflag_gen_dir_/perfetto_build_flags.h"

  perfetto_component_build = false
  if (defined(is_component_build) && is_component_build) {
    perfetto_component_build = true
  }
  perfetto_force_dlog_on = perfetto_force_dlog == "on"
  perfetto_force_dlog_off = perfetto_force_dlog == "off"

  # We can't just use (is_linux || is_android) in perfetto.gni because that
  # doesn't work in Android Mac host builds. We lose the GN notion of OS once
  # we run the tools/gen_xxx generators.
  if (enable_perfetto_watchdog) {
    perfetto_watchdog = "PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() || " +
                        "PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX()"
  } else {
    perfetto_watchdog = "0"
  }
  if (enable_perfetto_tools) {
    perfetto_local_symbolizer = "PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX()"
  } else {
    perfetto_local_symbolizer = "0"
  }
  if (enable_perfetto_trace_processor_httpd) {
    perfetto_tp_httpd = "PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() || " +
                        "PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() || " +
                        "PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MACOSX()"
  } else {
    perfetto_tp_httpd = "0"
  }

  response_file_contents = [
    "--flags",  # Keep this marker first.
    "PERFETTO_ANDROID_BUILD=$perfetto_build_with_android",
    "PERFETTO_CHROMIUM_BUILD=$build_with_chromium",
    "PERFETTO_STANDALONE_BUILD=$perfetto_build_standalone",
    "PERFETTO_START_DAEMONS=$start_daemons_for_testing",
    "PERFETTO_IPC=$enable_perfetto_ipc",
    "PERFETTO_WATCHDOG=$perfetto_watchdog",
    "PERFETTO_COMPONENT_BUILD=$perfetto_component_build",
    "PERFETTO_FORCE_DLOG_ON=$perfetto_force_dlog_on",
    "PERFETTO_FORCE_DLOG_OFF=$perfetto_force_dlog_off",
    "PERFETTO_VERSION_GEN=$enable_perfetto_version_gen",
    "PERFETTO_TP_SQLITE=$enable_perfetto_trace_processor_sqlite",
    "PERFETTO_TP_PERCENTILE=$enable_perfetto_trace_processor_percentile",
    "PERFETTO_TP_LINENOISE=$enable_perfetto_trace_processor_linenoise",
    "PERFETTO_TP_METRICS=$enable_perfetto_trace_processor_metrics",
    "PERFETTO_TP_FTRACE=$enable_perfetto_trace_processor_ftrace",
    "PERFETTO_TP_HTTPD=$perfetto_tp_httpd",
    "PERFETTO_TP_SYSTEM_PROBES=$enable_perfetto_trace_processor_system_probes",
    "PERFETTO_TP_ANDROID_PROBES=$enable_perfetto_trace_processor_android_probes",
    "PERFETTO_TP_GRAPHICS=$enable_perfetto_trace_processor_graphics",
    "PERFETTO_TP_JSON=$enable_perfetto_trace_processor_json",
    "PERFETTO_TP_FUCHSIA=$enable_perfetto_trace_processor_fuchsia",
    "PERFETTO_LOCAL_SYMBOLIZER=$perfetto_local_symbolizer",
  ]

  rel_out_path = rebase_path(gen_header_path, "$root_build_dir")
  args = [
    "--out",
    rel_out_path,
    "--rsp",
    "{{response_file_name}}",
  ]

  outputs = [
    gen_header_path,
  ]
}

# All targets should depend on this target to inherit the right flags and
# include directories.
group("default_deps") {
  public_configs = [ ":default_config" ]
  deps = [
    ":gen_buildflags",
  ]
  if (perfetto_build_standalone) {
    public_deps = [
      "//gn/standalone/libc++:deps",
      "//gn/standalone/sanitizers:deps",
    ]
  }
}

# The config that all targets in the perfetto codebase inherit by virtue of
# having explicit deps on //gn:default_deps. This config is NOT propagated up to
# embedders that depend on perfetto (e.g. chrome). :public_config (see below) is
# used for that.
config("default_config") {
  configs = [ ":public_config" ]
  defines = [ "PERFETTO_IMPLEMENTATION" ]
  include_dirs = [ ".." ]

  if (build_with_chromium && is_android) {
    # Included for __android_log_print
    libs = [ "log" ]
  }
}

# This config is propagated to embedders via libperfetto. It's also included in
# the default_config above.
config("public_config") {
  include_dirs = [
    "../include",

    # For perfetto_build_flags.h
    buildflag_gen_dir_,
  ]
}

config("asan_instrumentation") {
  if (use_sanitizer_configs_without_instrumentation) {
    defines = [ "ADDRESS_SANITIZER_WITHOUT_INSTRUMENTATION" ]
  }
}

if (perfetto_root_path != "//") {
  config("gtest_and_gmock_embedder_config") {
    include_dirs = [
      "//testing/gtest/include",
      "//testing/gmock/include",
    ]
  }
}

group("gtest_and_gmock") {
  testonly = true

  if (perfetto_root_path == "//") {
    public_deps = [
      "//buildtools:gmock",
      "//buildtools:gtest",
    ]
  } else {
    public_configs = [ ":gtest_and_gmock_embedder_config" ]
    public_deps = [
      "//testing/gmock",
      "//testing/gtest",
    ]
  }
}

group("gtest_main") {
  testonly = true

  if (perfetto_root_path == "//") {
    public_deps = [
      "//buildtools:gtest_main",
    ]
  } else if (build_with_chromium) {
    public_deps = [
      "//base/test:run_all_unittests",
    ]
  } else {
    public_deps = [
      "//testing/gtest:gtest_main",
    ]
  }
}

# Full protobuf is just for host tools .No binary shipped on device should
# depend on this.
whitelisted_protobuf_full_deps = [
  "../tools/*",
  "../src/ipc/protoc_plugin:*",
  "../src/protozero/protoc_plugin:*",
  "../src/trace_processor:trace_processor_shell",
]

group("protoc") {
  public_deps = [
    "${perfetto_protobuf_target_prefix}:protoc($host_toolchain)",
  ]
}

# protoc compiler library, it's used for building protoc plugins and by
# trace_processor_shell to dynamically load .proto files for metrics.
group("protoc_lib") {
  visibility = whitelisted_protobuf_full_deps
  if (current_toolchain == host_toolchain) {
    public_deps = [
      "${perfetto_protobuf_target_prefix}:protoc_lib",
    ]
  }
}

group("protobuf_full") {
  visibility = whitelisted_protobuf_full_deps
  if (current_toolchain == host_toolchain) {
    public_deps = [
      "${perfetto_protobuf_target_prefix}:protobuf_full",
    ]
  }
}

group("protobuf_lite") {
  public_deps = [
    "${perfetto_protobuf_target_prefix}:protobuf_lite",
  ]
}

# The Google C++ Benchmark library.
# Only available in standalone builds.
if (enable_perfetto_benchmarks) {
  group("benchmark") {
    testonly = true
    public_deps = [
      "//buildtools:benchmark",
    ]
  }
}

# Libbacktrace, used for printing stack traces from crash handler, only in
# standalone debug builds.
if (perfetto_build_standalone && (is_linux || is_android)) {
  group("libbacktrace") {
    public_deps = [
      "//buildtools:libbacktrace",
    ]
  }
}

if (enable_perfetto_trace_processor_sqlite) {
  group("sqlite") {
    if (perfetto_root_path == "//") {
      public_deps = [
        "//buildtools:sqlite",
      ]
    } else {
      public_deps = [
        "//third_party/sqlite:sqlite",
      ]
      public_configs = [ ":sqlite_third_party_include_path" ]
    }
  }

  config("sqlite_third_party_include_path") {
    include_dirs = [ "//third_party/sqlite" ]
  }
}  # if (enable_perfetto_trace_processor_sqlite)

if (enable_perfetto_trace_processor_json) {
  group("jsoncpp") {
    if (perfetto_root_path == "//") {
      public_configs = [ "//buildtools:jsoncpp_config" ]
      public_deps = [
        "//buildtools:jsoncpp",
      ]
    } else {
      public_deps = [
        "//third_party/jsoncpp:jsoncpp",
      ]
    }
  }
}

if (enable_perfetto_trace_processor_linenoise) {
  # Used by the trace_processor_shell for REPL history.
  # Only available in standalone builds.
  group("linenoise") {
    public_deps = [
      "//buildtools:linenoise",
    ]
  }
}  # if (enable_perfetto_trace_processor_linenoise)

# Only used by src/profiling in standalone and android builds.
if (enable_perfetto_heapprofd) {
  group("libunwindstack") {
    public_configs = [ "//buildtools:libunwindstack_config" ]
    public_deps = [
      "//buildtools:libunwindstack",
    ]
  }
}

# Zlib is used both by trace_processor and by perfetto_cmd.
if (enable_perfetto_trace_processor || enable_perfetto_platform_services) {
  group("zlib") {
    if (perfetto_root_path == "//") {
      public_configs = [ "//buildtools:zlib_config" ]
      public_deps = [
        "//buildtools:zlib",
      ]
    } else {
      public_configs = [ "//third_party/zlib:zlib_config" ]
      public_deps = [
        "//third_party/zlib",
      ]
    }
  }
}

# Used by fuzzers.
if (enable_perfetto_fuzzers && use_libfuzzer) {
  group("libfuzzer") {
    assert(perfetto_root_path == "//")
    public_deps = [
      "//buildtools:libfuzzer",
    ]
  }
}
