blob: d16a46b43d79fd8adc74fcc6a1d01a0df42ca5ac [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.
load(
"//pw_build:pigweed.bzl",
"pw_cc_test",
"pw_facade",
)
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
cc_library(
name = "dispatcher",
hdrs = [
"public/pw_async/dispatcher.h",
"public/pw_async/function_dispatcher.h",
],
includes = ["public"],
deps = [
":types",
"//pw_chrono:system_clock",
"//pw_function",
"//pw_status",
],
)
pw_facade(
name = "task",
hdrs = ["public/pw_async/task.h"],
backend = ":task_backend",
includes = ["public"],
deps = [
":types",
"//pw_chrono:system_clock",
"//pw_function",
"//pw_status",
],
)
label_flag(
name = "task_backend",
build_setting_default = "//pw_async_basic:task",
)
cc_library(
name = "types",
hdrs = [
"public/pw_async/context.h",
"public/pw_async/task_function.h",
],
includes = ["public"],
deps = [
"//pw_function",
"//pw_status",
],
)
pw_facade(
name = "fake_dispatcher",
hdrs = ["public/pw_async/fake_dispatcher.h"],
backend = ":fake_dispatcher_backend",
includes = ["public"],
deps = [
":dispatcher",
],
)
label_flag(
name = "fake_dispatcher_backend",
build_setting_default = "//pw_async_basic:fake_dispatcher",
)
pw_cc_test(
name = "fake_dispatcher_test",
srcs = ["fake_dispatcher_test.cc"],
deps = [
":fake_dispatcher",
"//pw_containers:vector",
"//pw_log",
"//pw_string:to_string",
"//pw_sync:timed_thread_notification",
"//pw_thread:thread",
],
)
cc_library(
name = "fake_dispatcher_fixture",
hdrs = ["public/pw_async/fake_dispatcher_fixture.h"],
includes = ["public"],
deps = [":fake_dispatcher"],
)
cc_library(
name = "heap_dispatcher",
srcs = ["heap_dispatcher.cc"],
hdrs = ["public/pw_async/heap_dispatcher.h"],
includes = ["public"],
deps = [
":dispatcher",
":task",
":types",
"//pw_result",
],
)