# Copyright (C) 2018 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.gni")

# This GN file should not be referenced in chromium builds.
assert(!build_with_chromium)

# This target is supported only in in-tree builds of Android. It contains
# code that is not NDK-clean and references other repos in the Android tree.
# perfetto_build_with_android is only true when running the GN -> Android.bp
# build file translator //tools/gen_android_bp .
if (perfetto_build_with_android) {
  shared_library("libperfetto_android_internal") {
    deps = [
      ":headers",
      "../../gn:default_deps",
    ]
    sources = [
      "atrace_hal.cc",
      "health_hal.cc",
      "incident_service.cc",
      "power_stats.cc",
      "statsd.cc",
      "statsd_logging.cc",
      "tracing_service_proxy.cc",
    ]
    libs = [
      "android.hardware.health@2.0",
      "android.hardware.health-V2-ndk",
      "android.hardware.power.stats@1.0",
      "android.hardware.power.stats-V1-cpp",
      "android.hardware.atrace@1.0",
      "statslog_perfetto",
      "statssocket",
      "cutils",
      "base",
      "binder",
      "binder_ndk",
      "log",
      "hidlbase",
      "incident",
      "services",
      "tracingproxy",
      "utils",
      "statspull",
    ]

    # This target should never depend on any other perfetto target to avoid ODR
    # violation by doubly linking code in two .so(s) loaded in the same exe.
    assert_no_deps = [
      "//include/*",
      "//src/base/*",
      "//src/tracing/*",
    ]
  }
}  # if (perfetto_build_with_android)

source_set("headers") {
  deps = [
    "../../gn:default_deps",
    "../android_stats:perfetto_atoms",
  ]
  sources = [
    "atrace_hal.h",
    "health_hal.h",
    "incident_service.h",
    "power_stats.h",
    "statsd.h",
    "statsd_logging.h",
    "tracing_service_proxy.h",
  ]
}

source_set("lazy_library_loader") {
  public_deps = [ ":headers" ]
  deps = [
    "../../gn:default_deps",
    "../../src/base",
  ]
  sources = [
    "lazy_library_loader.cc",
    "lazy_library_loader.h",
  ]
  if (!is_win) {
    libs = [ "dl" ]
  }
}
