Ewout van Bekkum | 3c61ae9 | 2020-10-30 15:52:25 -0700 | [diff] [blame] | 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 | |
| 15 | load( |
| 16 | "//pw_build:pigweed.bzl", |
| 17 | "pw_cc_library", |
| 18 | ) |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 19 | load( |
| 20 | "//pw_build:selects.bzl", |
| 21 | "TARGET_COMPATIBLE_WITH_HOST_SELECT", |
| 22 | ) |
Ewout van Bekkum | 3c61ae9 | 2020-10-30 15:52:25 -0700 | [diff] [blame] | 23 | |
| 24 | package(default_visibility = ["//visibility:public"]) |
| 25 | |
Rob Mohr | 5fc2541 | 2021-06-23 09:35:23 -0700 | [diff] [blame] | 26 | licenses(["notice"]) |
Ewout van Bekkum | 3c61ae9 | 2020-10-30 15:52:25 -0700 | [diff] [blame] | 27 | |
| 28 | pw_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 | |
| 45 | pw_cc_library( |
| 46 | name = "system_clock", |
Nathaniel Brough | c2d5781 | 2021-04-18 22:52:00 +0800 | [diff] [blame] | 47 | target_compatible_with = select(TARGET_COMPATIBLE_WITH_HOST_SELECT), |
Ewout van Bekkum | 3c61ae9 | 2020-10-30 15:52:25 -0700 | [diff] [blame] | 48 | deps = [ |
| 49 | ":system_clock_headers", |
| 50 | "//pw_chrono:system_clock_facade", |
| 51 | ], |
| 52 | ) |
Ewout van Bekkum | 2140484 | 2021-06-08 11:06:17 -0700 | [diff] [blame] | 53 | |
| 54 | pw_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 Bekkum | 2140484 | 2021-06-08 11:06:17 -0700 | [diff] [blame] | 68 | "//pw_chrono:system_timer_facade", |
Rob Mohr | e93dc3b | 2021-07-12 07:28:32 -0700 | [diff] [blame] | 69 | "//pw_function", |
Ewout van Bekkum | 2140484 | 2021-06-08 11:06:17 -0700 | [diff] [blame] | 70 | ], |
| 71 | ) |
| 72 | |
| 73 | pw_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 | ) |