# 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_bytes",
    "$dir_pw_function",
    "$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_assert",
    "$dir_pw_bytes",
    "$dir_pw_function",
    "$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_test("data_link_test") {
  sources = [ "data_link_test.cc" ]
  deps = [
    ":data_link",
    "$dir_pw_bytes",
    "$dir_pw_status",
  ]
}

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

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