Brian Silverman | 019de8b | 2019-02-02 16:55:30 -0800 | [diff] [blame] | 1 | licenses(["notice"]) |
| 2 | |
| 3 | load("//tools:environments.bzl", "mcu_cpus") |
| 4 | |
| 5 | cc_library( |
| 6 | name = "optional", |
| 7 | hdrs = [ |
| 8 | "tl/optional.hpp", |
| 9 | ], |
| 10 | compatible_with = mcu_cpus, |
| 11 | includes = ["."], |
| 12 | visibility = ["//visibility:public"], |
| 13 | ) |
| 14 | |
| 15 | cc_library( |
| 16 | name = "catch", |
| 17 | hdrs = [ |
| 18 | "tests/catch.hpp", |
| 19 | ], |
| 20 | ) |
| 21 | |
| 22 | # Create a small wrapper because the tests want to #include "optional.hpp" |
| 23 | # directly. |
| 24 | cc_library( |
| 25 | name = "optional_test_wrapper", |
| 26 | includes = [ |
| 27 | "./tl/", |
| 28 | ], |
| 29 | deps = [ |
| 30 | ":optional", |
| 31 | ], |
| 32 | ) |
| 33 | |
| 34 | cc_test( |
| 35 | name = "optional_test", |
| 36 | srcs = glob([ |
| 37 | "tests/*.cpp", |
| 38 | ]), |
| 39 | copts = [ |
| 40 | "-fexceptions", |
| 41 | "-Wno-unused-parameter", |
| 42 | ], |
| 43 | deps = [ |
| 44 | ":catch", |
| 45 | ":optional_test_wrapper", |
| 46 | ], |
| 47 | ) |