-
Notifications
You must be signed in to change notification settings - Fork 97
/
BUILD.bazel
118 lines (107 loc) · 2.64 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
load("@rules_swiftnav//cc:defs.bzl", "UNIT", "swift_c_library", "swift_cc_test")
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
SBP_INCLUDE = glob(["include/**/*.h"])
SBP_INCLUDE_INTERNAL = glob(["src/**/*.h"])
refresh_compile_commands(
name = "gen_compile_commands",
visibility = ["//visibility:public"],
)
swift_c_library(
name = "sbp",
srcs = [
"src/edc.c",
"src/sbp.c",
"src/string/sbp_string.c",
"src/string/multipart.c",
"src/string/null_terminated.c",
"src/string/double_null_terminated.c",
"src/string/unterminated.c",
# generated files
"src/acquisition.c",
"src/bootload.c",
"src/ext_events.c",
"src/file_io.c",
"src/flash.c",
"src/gnss.c",
"src/imu.c",
"src/integrity.c",
"src/linux.c",
"src/logging.c",
"src/mag.c",
"src/navigation.c",
"src/ndb.c",
"src/observation.c",
"src/orientation.c",
"src/piksi.c",
"src/profiling.c",
"src/sbas.c",
"src/settings.c",
"src/signing.c",
"src/solution_meta.c",
"src/ssr.c",
"src/system.c",
"src/telemetry.c",
"src/tracking.c",
"src/user.c",
"src/vehicle.c",
],
hdrs = SBP_INCLUDE + SBP_INCLUDE_INTERNAL,
copts = [
"-Ic/src/include",
"-Iexternal/libsbp/c/src/include",
],
includes = [
"include",
],
nocopts = ["-Wstack-protector"],
visibility = ["//visibility:public"],
)
filegroup(
name = "sbp_headers",
srcs = SBP_INCLUDE,
visibility = ["//visibility:public"],
)
SBP_C_SOURCES = glob(["test/auto*.c"])
swift_cc_test(
name = "sbp-test",
srcs = [
"test/check_main.c",
"test/check_edc.c",
"test/check_sbp.c",
"test/check_bitfield_macros.c",
"test/check_suites.h",
] + SBP_C_SOURCES,
includes = ["include/libsbp"],
type = UNIT,
deps = [
":sbp",
"@check",
],
)
SBP_CPP_C_SOURCES = glob(["test/cpp/auto*.cc"])
swift_cc_test(
name = "sbp-cpp-test",
srcs = SBP_CPP_C_SOURCES,
type = UNIT,
deps = [
":sbp",
"@googletest//:gtest_main",
],
)
swift_cc_test(
name = "sbp-string-test",
srcs = [
"test/string/test_double_null_terminated.cc",
"test/string/test_multipart.cc",
"test/string/test_null_terminated.cc",
"test/string/test_unterminated.cc",
],
includes = [
"src/include",
],
type = UNIT,
deps = [
":sbp",
"@googletest//:gtest_main",
],
)