# 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",
    "$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",
    "$dir_pw_multibuf:chunk_region_tracker",
  ]
  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_allocator:simple_allocator",
    "$dir_pw_assert",
    "$dir_pw_log",
    "$dir_pw_sync:thread_notification",
    "$dir_pw_thread:thread",
    "$dir_pw_thread:thread_core",
  ]
}

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 = [
    ":socket_data_link",
    "$dir_pw_allocator:simple_allocator",
    "$dir_pw_bytes",
    "$dir_pw_status",
  ]
}

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