• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 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)
19load(
20    "//pw_build:selects.bzl",
21    "TARGET_COMPATIBLE_WITH_HOST_SELECT",
22)
23
24package(default_visibility = ["//visibility:public"])
25
26licenses(["notice"])
27
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",
47    target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT),
48    deps = [
49        ":system_clock_headers",
50        "//pw_chrono:system_clock_facade",
51    ],
52)
53
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",
68        "//pw_chrono:system_timer_facade",
69        "//pw_function",
70    ],
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)
84