# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//third_party/abseil-cpp/absl.gni")

absl_source_set("graphcycles_internal") {
  sources = [ "internal/graphcycles.cc" ]
  public = [ "internal/graphcycles.h" ]
  deps = [
    "//third_party/abseil-cpp/absl/base",
    "//third_party/abseil-cpp/absl/base:base_internal",
    "//third_party/abseil-cpp/absl/base:config",
    "//third_party/abseil-cpp/absl/base:core_headers",
    "//third_party/abseil-cpp/absl/base:malloc_internal",
    "//third_party/abseil-cpp/absl/base:raw_logging_internal",
  ]
  visibility = [ "//third_party/abseil-cpp/absl/*" ]
}

absl_source_set("kernel_timeout_internal") {
  sources = [ "internal/kernel_timeout.cc" ]
  public = [ "internal/kernel_timeout.h" ]
  deps = [
    "//third_party/abseil-cpp/absl/base",
    "//third_party/abseil-cpp/absl/base:config",
    "//third_party/abseil-cpp/absl/base:core_headers",
    "//third_party/abseil-cpp/absl/base:raw_logging_internal",
    "//third_party/abseil-cpp/absl/time",
  ]
  visibility = [ ":*" ]
}

absl_test("kernel_timeout_internal_test") {
  sources = [ "internal/kernel_timeout_test.cc" ]
  deps = [
    ":kernel_timeout_internal",
    "//third_party/abseil-cpp/absl/base:config",
    "//third_party/abseil-cpp/absl/random",
    "//third_party/abseil-cpp/absl/time",
  ]
}

absl_source_set("synchronization") {
  if (use_cobalt_customizations) {
    # Minimal support for absl::Mutex needed for logging and Cord.
    sources = [ "mutex_starboard.cc" ]
    public = [ "mutex.h" ]
    deps = [
      ":kernel_timeout_internal",
      "//starboard:starboard_headers_only",
      "//third_party/abseil-cpp/absl/base",
      "//third_party/abseil-cpp/absl/base:core_headers",
      "//third_party/abseil-cpp/absl/base:malloc_internal",
      "//third_party/abseil-cpp/absl/time",
    ]
  } else {
  sources = [
    "barrier.cc",
    "blocking_counter.cc",
    "internal/create_thread_identity.cc",
    "internal/futex_waiter.cc",
    "internal/per_thread_sem.cc",
    "internal/pthread_waiter.cc",
    "internal/sem_waiter.cc",
    "internal/stdcpp_waiter.cc",
    "internal/waiter_base.cc",
    "internal/win32_waiter.cc",
    "mutex.cc",
    "notification.cc",
  ]
  public = [
    "barrier.h",
    "blocking_counter.h",
    "internal/create_thread_identity.h",
    "internal/futex.h",
    "internal/futex_waiter.h",
    "internal/per_thread_sem.h",
    "internal/pthread_waiter.h",
    "internal/sem_waiter.h",
    "internal/stdcpp_waiter.h",
    "internal/waiter.h",
    "internal/waiter_base.h",
    "internal/win32_waiter.h",
    "mutex.h",
    "notification.h",
  ]
  deps = [
    ":graphcycles_internal",
    ":kernel_timeout_internal",
    "//third_party/abseil-cpp/absl/base",
    "//third_party/abseil-cpp/absl/base:atomic_hook",
    "//third_party/abseil-cpp/absl/base:base_internal",
    "//third_party/abseil-cpp/absl/base:config",
    "//third_party/abseil-cpp/absl/base:core_headers",
    "//third_party/abseil-cpp/absl/base:dynamic_annotations",
    "//third_party/abseil-cpp/absl/base:malloc_internal",
    "//third_party/abseil-cpp/absl/base:raw_logging_internal",
    "//third_party/abseil-cpp/absl/debugging:stacktrace",
    "//third_party/abseil-cpp/absl/debugging:symbolize",
    "//third_party/abseil-cpp/absl/time",
  ]
  }
}

absl_test("waiter_test") {
  # Synchronization is not Starboardized since at this time it's banned for use
  # in Chromium code.
  if (!use_cobalt_customizations) {
  sources = [ "internal/waiter_test.cc" ]
  deps = [
    ":kernel_timeout_internal",
    ":synchronization",
    ":thread_pool",
    "//third_party/abseil-cpp/absl/base:config",
    "//third_party/abseil-cpp/absl/random",
    "//third_party/abseil-cpp/absl/time",
  ]
  } else {
    deps = []
  }
}

absl_source_set("thread_pool") {
  testonly = true
  public = [ "internal/thread_pool.h" ]
  deps = [
    ":synchronization",
    "//third_party/abseil-cpp/absl/base:core_headers",
    "//third_party/abseil-cpp/absl/functional:any_invocable",
  ]
  visibility = [ "//third_party/abseil-cpp/absl/*" ]
}

absl_source_set("per_thread_sem_test_common") {
  testonly = true
  sources = [ "internal/per_thread_sem_test.cc" ]
  deps = [
    ":synchronization",
    "//third_party/abseil-cpp/absl/base",
    "//third_party/abseil-cpp/absl/base:config",
    "//third_party/abseil-cpp/absl/strings",
    "//third_party/abseil-cpp/absl/time",
    "//third_party/googletest:gtest",
  ]
}

# absl_test("mutex_method_pointer_test") {
#   sources = [ "mutex_method_pointer_test.cc" ]
#   deps = [
#     ":synchronization",
#     "//third_party/abseil-cpp/absl/base:config",
#   ]
# }
