blob: ea49ba965c31e4b322442359dcc93218e6a3fc24 [file] [log] [blame]
# 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:header_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_data_link requires Linux sys/epoll.h
if (host_os == "linux") {
pw_executable("sample_app") {
sources = [ "sample_app.cc" ]
deps = [
":data_link",
":data_link_thread",
":server_socket",
":socket_data_link",
"$dir_pw_allocator:block_allocator",
"$dir_pw_assert",
"$dir_pw_log",
"$dir_pw_sync:thread_notification",
"$dir_pw_thread:thread",
"$dir_pw_thread:thread_core",
]
}
} else {
group("sample_app") {
}
}
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:block_allocator",
"$dir_pw_bytes",
"$dir_pw_status",
]
}
pw_test_group("tests") {
tests = []
# pw_data_link requires Linux sys/epoll.h
if (host_os == "linux") {
tests += [
":data_link_test",
":socket_data_link_test",
]
}
}