blob: 1fa008f5b8a90a3eae2ad50009db0716ccd03966 [file] [log] [blame]
Ewout van Bekkum3c61ae92020-10-30 15:52:25 -07001# Copyright 2020 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7# https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load(
16 "//pw_build:pigweed.bzl",
17 "pw_cc_library",
18)
Nathaniel Broughc2d57812021-04-18 22:52:00 +080019load(
20 "//pw_build:selects.bzl",
21 "TARGET_COMPATIBLE_WITH_HOST_SELECT",
22)
Ewout van Bekkum3c61ae92020-10-30 15:52:25 -070023
24package(default_visibility = ["//visibility:public"])
25
Rob Mohr5fc25412021-06-23 09:35:23 -070026licenses(["notice"])
Ewout van Bekkum3c61ae92020-10-30 15:52:25 -070027
28pw_cc_library(
29 name = "system_clock_headers",
30 hdrs = [
31 "public/pw_chrono_stl/system_clock_config.h",
32 "public/pw_chrono_stl/system_clock_inline.h",
33 "public_overrides/pw_chrono_backend/system_clock_config.h",
34 "public_overrides/pw_chrono_backend/system_clock_inline.h",
35 ],
36 includes = [
37 "public",
38 "public_overrides",
39 ],
40 deps = [
41 "//pw_chrono:epoch",
42 ],
43)
44
45pw_cc_library(
46 name = "system_clock",
Nathaniel Broughc2d57812021-04-18 22:52:00 +080047 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT),
Ewout van Bekkum3c61ae92020-10-30 15:52:25 -070048 deps = [
49 ":system_clock_headers",
50 "//pw_chrono:system_clock_facade",
51 ],
52)
Ewout van Bekkum21404842021-06-08 11:06:17 -070053
54pw_cc_library(
55 name = "system_timer_headers",
56 hdrs = [
57 "public/pw_chrono_stl/system_timer_inline.h",
58 "public/pw_chrono_stl/system_timer_native.h",
59 "public_overrides/pw_chrono_backend/system_timer_inline.h",
60 "public_overrides/pw_chrono_backend/system_timer_native.h",
61 ],
62 includes = [
63 "public",
64 "public_overrides",
65 ],
66 deps = [
67 "//pw_chrono:system_clock",
Ewout van Bekkum21404842021-06-08 11:06:17 -070068 "//pw_chrono:system_timer_facade",
Rob Mohre93dc3b2021-07-12 07:28:32 -070069 "//pw_function",
Ewout van Bekkum21404842021-06-08 11:06:17 -070070 ],
71)
72
73pw_cc_library(
74 name = "system_timer",
75 srcs = [
76 "system_timer.cc",
77 ],
78 target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT),
79 deps = [
80 ":system_timer_headers",
81 "//pw_chrono:system_timer_facade",
82 ],
83)