Alexei Frolov | e39af8d | 2020-12-30 14:55:09 -0800 | [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 | include($ENV{PW_ROOT}/pw_build/pigweed.cmake) |
| 16 | |
Ewout van Bekkum | f27605e | 2022-01-19 17:13:56 -0800 | [diff] [blame] | 17 | pw_add_module_library(pw_chrono.epoch |
| 18 | HEADERS |
| 19 | public/pw_chrono/epoch.h |
| 20 | PUBLIC_INCLUDES |
| 21 | public |
| 22 | ) |
| 23 | |
Alexei Frolov | e39af8d | 2020-12-30 14:55:09 -0800 | [diff] [blame] | 24 | pw_add_facade(pw_chrono.system_clock |
Ewout van Bekkum | f27605e | 2022-01-19 17:13:56 -0800 | [diff] [blame] | 25 | HEADERS |
| 26 | public/pw_chrono/internal/system_clock_macros.h |
| 27 | public/pw_chrono/system_clock.h |
| 28 | PUBLIC_INCLUDES |
| 29 | public |
| 30 | PUBLIC_DEPS |
| 31 | pw_chrono.epoch |
| 32 | pw_preprocessor |
Alexei Frolov | e39af8d | 2020-12-30 14:55:09 -0800 | [diff] [blame] | 33 | SOURCES |
| 34 | system_clock.cc |
Alexei Frolov | e39af8d | 2020-12-30 14:55:09 -0800 | [diff] [blame] | 35 | ) |
Ewout van Bekkum | f27605e | 2022-01-19 17:13:56 -0800 | [diff] [blame] | 36 | |
| 37 | pw_add_facade(pw_chrono.system_timer |
| 38 | HEADERS |
| 39 | public/pw_chrono/system_timer.h |
| 40 | PUBLIC_INCLUDES |
| 41 | public |
| 42 | PUBLIC_DEPS |
| 43 | pw_chrono.system_clock |
| 44 | pw_function |
| 45 | ) |
| 46 | |
| 47 | # Dependency injectable implementation of pw::chrono::SystemClock::Interface. |
| 48 | pw_add_module_library(pw_chrono.simulated_system_clock |
| 49 | HEADERS |
| 50 | public/pw_chrono/simulated_system_clock.h |
| 51 | PUBLIC_INCLUDES |
| 52 | public |
| 53 | PUBLIC_DEPS |
| 54 | pw_chrono.system_clock |
| 55 | pw_sync.interrupt_spin_lock |
| 56 | ) |
| 57 | |
| 58 | # TODO(ewout): Renable this once we've resolved the backend variable definition |
| 59 | # ordering issue, likely by mirroring GN's definition of variables in external |
| 60 | # files which can be imported where needed. |
| 61 | # if((NOT "${pw_chrono.system_clock_BACKEND}" |
| 62 | # STREQUAL "pw_chrono.system_clock.NO_BACKEND_SET") AND |
| 63 | # (NOT "${pw_sync.interrupt_spin_lock_BACKEND}" |
| 64 | # STREQUAL "pw_sync.interrupt_spin_lock.NO_BACKEND_SET")) |
| 65 | # pw_add_test(pw_chrono.simulated_system_clock_test |
| 66 | # SOURCES |
| 67 | # simulated_system_clock_test.cc |
| 68 | # DEPS |
| 69 | # pw_chrono.simulated_system_clock |
| 70 | # GROUPS |
| 71 | # modules |
| 72 | # pw_chrono |
| 73 | # ) |
| 74 | # endif() |
| 75 | |
| 76 | if(NOT "${pw_chrono.system_clock_BACKEND}" |
| 77 | STREQUAL "pw_chrono.system_clock.NO_BACKEND_SET") |
| 78 | pw_add_test(pw_chrono.system_clock_facade_test |
| 79 | SOURCES |
| 80 | system_clock_facade_test.cc |
| 81 | system_clock_facade_test_c.c |
| 82 | DEPS |
| 83 | pw_chrono.system_clock |
| 84 | pw_preprocessor |
| 85 | GROUPS |
| 86 | modules |
| 87 | pw_chrono |
| 88 | ) |
| 89 | endif() |
| 90 | |
| 91 | if(NOT "${pw_chrono.system_timer_BACKEND}" |
| 92 | STREQUAL "pw_chrono.system_timer.NO_BACKEND_SET") |
| 93 | pw_add_test(pw_chrono.system_timer_facade_test |
| 94 | SOURCES |
| 95 | system_timer_facade_test.cc |
| 96 | DEPS |
| 97 | pw_chrono.system_timer |
| 98 | pw_sync.thread_notification |
| 99 | GROUPS |
| 100 | modules |
| 101 | pw_chrono |
| 102 | ) |
| 103 | endif() |