# Copyright 2021 The Pigweed Authors
#
# 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
#
#     https://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("//build_overrides/pigweed.gni")

import("$dir_pw_build/module_config.gni")
import("$dir_pw_build/target_types.gni")
import("$dir_pw_chrono/backend.gni")
import("$dir_pw_docgen/docs.gni")
import("$dir_pw_thread/backend.gni")
import("$dir_pw_unit_test/test.gni")

declare_args() {
  # The build target that overrides the default configuration options for this
  # module. This should point to a source set that provides defines through a
  # public config (which may -include a file or add defines directly).
  pw_thread_embos_CONFIG = pw_build_DEFAULT_MODULE_CONFIG
}

config("public_include_path") {
  include_dirs = [ "public" ]
  visibility = [ ":*" ]
}

config("backend_config") {
  include_dirs = [ "public_overrides" ]
  visibility = [ ":*" ]
}

pw_source_set("config") {
  public = [ "public/pw_thread_embos/config.h" ]
  public_configs = [ ":public_include_path" ]
  public_deps = [
    "$dir_pw_third_party/embos",
    pw_thread_embos_CONFIG,
  ]
}

# This target provides the backend for pw::thread::Id.
pw_source_set("id") {
  public_configs = [
    ":public_include_path",
    ":backend_config",
  ]
  public_deps = [
    "$dir_pw_assert",
    "$dir_pw_interrupt:context",
    "$dir_pw_third_party/embos",
  ]
  public = [
    "public/pw_thread_embos/id_inline.h",
    "public/pw_thread_embos/id_native.h",
    "public_overrides/pw_thread_backend/id_inline.h",
    "public_overrides/pw_thread_backend/id_native.h",
  ]
  deps = [ "$dir_pw_thread:id.facade" ]
}

if (pw_chrono_SYSTEM_CLOCK_BACKEND != "" && pw_thread_SLEEP_BACKEND != "") {
  # This target provides the backend for pw::thread::sleep_{for,until}.
  pw_source_set("sleep") {
    public_configs = [
      ":public_include_path",
      ":backend_config",
    ]
    public = [
      "public/pw_thread_embos/sleep_inline.h",
      "public_overrides/pw_thread_backend/sleep_inline.h",
    ]
    public_deps = [ "$dir_pw_chrono:system_clock" ]
    sources = [ "sleep.cc" ]
    deps = [
      "$dir_pw_assert",
      "$dir_pw_chrono_embos:system_clock",
      "$dir_pw_third_party/embos",
      "$dir_pw_thread:id",
      "$dir_pw_thread:sleep.facade",
    ]
    assert(pw_thread_OVERRIDE_SYSTEM_CLOCK_BACKEND_CHECK ||
               pw_chrono_SYSTEM_CLOCK_BACKEND ==
                   "$dir_pw_chrono_embos:system_clock",
           "The embOS pw::thread::sleep_{for,until} backend only works with " +
               "the embOS pw::chrono::SystemClock backend.")
  }
}

# This target provides the backend for pw::thread::Thread and the headers needed
# for thread creation.
pw_source_set("thread") {
  public_configs = [
    ":public_include_path",
    ":backend_config",
  ]
  public_deps = [
    ":config",
    "$dir_pw_assert",
    "$dir_pw_string",
    "$dir_pw_third_party/embos",
    "$dir_pw_thread:id",
    "$dir_pw_thread:thread.facade",
  ]
  public = [
    "public/pw_thread_embos/context.h",
    "public/pw_thread_embos/options.h",
    "public/pw_thread_embos/thread_inline.h",
    "public/pw_thread_embos/thread_native.h",
    "public_overrides/pw_thread_backend/thread_inline.h",
    "public_overrides/pw_thread_backend/thread_native.h",
  ]
  allow_circular_includes_from = [ "$dir_pw_thread:thread.facade" ]
  sources = [ "thread.cc" ]
}

# This target provides the backend for pw::thread::yield.
pw_source_set("yield") {
  public_configs = [
    ":public_include_path",
    ":backend_config",
  ]
  public = [
    "public/pw_thread_embos/yield_inline.h",
    "public_overrides/pw_thread_backend/yield_inline.h",
  ]
  public_deps = [
    "$dir_pw_assert",
    "$dir_pw_third_party/embos",
    "$dir_pw_thread:id",
  ]
  deps = [ "$dir_pw_thread:yield.facade" ]
}

pw_source_set("util") {
  public_configs = [ ":public_include_path" ]
  public_deps = [
    "$dir_pw_third_party/embos",
    dir_pw_function,
    dir_pw_status,
  ]
  public = [ "public/pw_thread_embos/util.h" ]
  sources = [ "util.cc" ]
}

pw_source_set("snapshot") {
  public_configs = [ ":public_include_path" ]
  public_deps = [
    ":config",
    "$dir_pw_third_party/embos",
    "$dir_pw_thread:protos.pwpb",
    "$dir_pw_thread:snapshot",
    dir_pw_bytes,
    dir_pw_function,
    dir_pw_log,
    dir_pw_protobuf,
    dir_pw_status,
  ]
  public = [ "public/pw_thread_embos/snapshot.h" ]
  sources = [ "snapshot.cc" ]
  deps = [ ":util" ]
}

pw_test_group("tests") {
  tests = [ ":thread_backend_test" ]
}

pw_source_set("test_threads") {
  public_deps = [ "$dir_pw_thread:test_threads" ]
  sources = [ "test_threads.cc" ]
  deps = [
    "$dir_pw_chrono:system_clock",
    "$dir_pw_thread:sleep",
    "$dir_pw_thread:thread",
    dir_pw_assert,
    dir_pw_log,
  ]
}

pw_test("thread_backend_test") {
  enable_if = pw_thread_THREAD_BACKEND == "$dir_pw_thread_embos:thread"
  deps = [
    ":test_threads",
    "$dir_pw_thread:thread_facade_test",
  ]
}

pw_doc_group("docs") {
  sources = [ "docs.rst" ]
}
