John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 1 | package(default_visibility = ["//visibility:public"]) |
| 2 | |
Brian Silverman | c03a30c | 2019-02-16 18:21:56 -0800 | [diff] [blame^] | 3 | load("//tools:environments.bzl", "mcu_cpus") |
| 4 | |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 5 | cc_library( |
| 6 | name = "time", |
| 7 | srcs = [ |
| 8 | "time.cc", |
| 9 | ], |
| 10 | hdrs = [ |
| 11 | "time.h", |
| 12 | ], |
Brian Silverman | c03a30c | 2019-02-16 18:21:56 -0800 | [diff] [blame^] | 13 | compatible_with = mcu_cpus, |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 14 | deps = [ |
| 15 | "//aos:macros", |
Brian Silverman | c03a30c | 2019-02-16 18:21:56 -0800 | [diff] [blame^] | 16 | "//aos/type_traits", |
| 17 | ] + select({ |
| 18 | # TODO(Brian): Deduplicate this (both CPU names and values). |
| 19 | "//tools:cpu_cortex_m4f": [ |
| 20 | "//motors/core", |
| 21 | ], |
| 22 | "//tools:cpu_cortex_m4f_k22": [ |
| 23 | "//motors/core", |
| 24 | ], |
| 25 | "//conditions:default": [ |
| 26 | "//aos/ipc_lib:shared_mem", |
| 27 | "//aos/logging", |
| 28 | "//aos/mutex", |
| 29 | ], |
| 30 | }), |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 31 | ) |
| 32 | |
| 33 | cc_test( |
| 34 | name = "time_test", |
| 35 | srcs = [ |
| 36 | "time_test.cc", |
| 37 | ], |
| 38 | deps = [ |
| 39 | ":time", |
| 40 | "//aos/logging", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 41 | "//aos/testing:googletest", |
Brian Silverman | c03a30c | 2019-02-16 18:21:56 -0800 | [diff] [blame^] | 42 | "//aos/util:death_test_log_implementation", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 43 | ], |
| 44 | ) |