# Copyright 2023 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_unit_test/test.gni")

config("default_config") {
  include_dirs = [ "public" ]
}

pw_source_set("data_link") {
  public_configs = [ ":default_config" ]
  public = [ "public/pw_data_link/data_link.h" ]
  public_deps = [
    "$dir_pw_allocator",
    "$dir_pw_bytes",
    "$dir_pw_function",
    "$dir_pw_multibuf",
    "$dir_pw_status",
  ]
}

pw_source_set("socket_data_link") {
  public_configs = [ ":default_config" ]
  public = [ "public/pw_data_link/socket_data_link.h" ]
  public_deps = [
    ":data_link",
    ":simple_allocator",
    "$dir_pw_allocator",
    "$dir_pw_assert",
    "$dir_pw_bytes",
    "$dir_pw_function",
    "$dir_pw_multibuf",
    "$dir_pw_status",
    "$dir_pw_string:to_string",
    "$dir_pw_sync:lock_annotations",
    "$dir_pw_sync:mutex",
  ]
  deps = [ "$dir_pw_log" ]
  sources = [ "socket_data_link.cc" ]
}

pw_source_set("data_link_thread") {
  public_configs = [ ":default_config" ]
  public = [ "public/pw_data_link/socket_data_link_thread.h" ]
  public_deps = [
    ":socket_data_link",
    "$dir_pw_status",
    "$dir_pw_sync:lock_annotations",
    "$dir_pw_sync:mutex",
    "$dir_pw_sync:thread_notification",
    "$dir_pw_thread:thread_core",
    "$dir_pw_thread:yield",
  ]
}

pw_source_set("server_socket") {
  public_configs = [ ":default_config" ]
  public = [ "public/pw_data_link/server_socket.h" ]
  sources = [ "server_socket.cc" ]
  public_deps = [
    "$dir_pw_assert",
    "$dir_pw_result",
    "$dir_pw_status",
  ]
}

pw_executable("sample_app") {
  sources = [ "sample_app.cc" ]
  deps = [
    ":data_link",
    ":data_link_thread",
    ":server_socket",
    ":socket_data_link",
    "$dir_pw_assert",
    "$dir_pw_log",
    "$dir_pw_sync:thread_notification",
    "$dir_pw_thread:thread",
    "$dir_pw_thread:thread_core",
  ]
}

pw_source_set("simple_allocator") {
  public_configs = [ ":default_config" ]
  public = [ "public/pw_data_link/simple_allocator.h" ]
  public_deps = [
    "$dir_pw_allocator",
    "$dir_pw_allocator:allocator_metric_proxy",
    "$dir_pw_allocator:split_free_list_allocator",
    "$dir_pw_assert",
    "$dir_pw_multibuf:chunk",
  ]
}

pw_test("data_link_test") {
  sources = [ "data_link_test.cc" ]
  deps = [
    ":data_link",
    "$dir_pw_allocator",
    "$dir_pw_bytes",
    "$dir_pw_multibuf",
    "$dir_pw_status",
  ]
}

pw_test("socket_data_link_test") {
  sources = [ "socket_data_link_test.cc" ]
  deps = [
    ":simple_allocator",
    ":socket_data_link",
    "$dir_pw_bytes",
    "$dir_pw_status",
  ]
}

pw_test_group("tests") {
  tests = [
    ":data_link_test",
    ":socket_data_link_test",
  ]
}
