blob: d550a656dd4ff5789349ad9531cfd173f87a8994 [file] [log] [blame]
Philipp Schrader9b1790e2018-03-10 20:21:30 -08001package(default_visibility = ["//visibility:public"])
Brian Silverman100534c2015-09-07 15:51:23 -04002
3cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -08004 name = "aos_sync",
5 srcs = [
6 "aos_sync.cc",
7 ],
8 hdrs = [
9 "aos_sync.h",
10 ],
Brian Silverman7a7c24d2018-09-01 17:49:09 -070011 compatible_with = [
12 "//tools:armhf-debian",
13 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080014 linkopts = [
15 "-lpthread",
16 ],
17 deps = [
18 "//aos:once",
John Park33858a32018-09-28 23:05:48 -070019 "//aos:macros",
20 "//aos/logging",
21 "//aos/util:compiler_memory_barrier",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080022 ],
Brian Silverman100534c2015-09-07 15:51:23 -040023)
24
25cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080026 name = "core_lib",
27 srcs = [
28 "core_lib.c",
29 ],
30 hdrs = [
31 "core_lib.h",
32 ],
Brian Silverman7a7c24d2018-09-01 17:49:09 -070033 compatible_with = [
34 "//tools:armhf-debian",
35 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080036 deps = [
37 ":aos_sync",
38 ":shared_mem_types",
39 ],
Brian Silverman100534c2015-09-07 15:51:23 -040040)
41
42cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080043 name = "shared_mem",
44 srcs = [
45 "shared_mem.c",
46 ],
47 hdrs = [
48 "shared_mem.h",
49 ],
Brian Silverman7a7c24d2018-09-01 17:49:09 -070050 compatible_with = [
51 "//tools:armhf-debian",
52 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080053 linkopts = [
54 "-lrt",
55 ],
56 deps = [
57 ":aos_sync",
58 ":core_lib",
59 ":shared_mem_types",
John Park33858a32018-09-28 23:05:48 -070060 "//aos/logging",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080061 ],
Austin Schuh044e18b2015-10-21 20:17:09 -070062)
63
64cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080065 # TODO(Brian): This should be shared_mem{,.h}, and the other one should be
66 # shared_mem_init{,.cc,.h}.
67 name = "shared_mem_types",
68 hdrs = [
69 "shared_mem_types.h",
70 ],
Brian Silverman7a7c24d2018-09-01 17:49:09 -070071 compatible_with = [
72 "//tools:armhf-debian",
73 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080074 deps = [
75 ":aos_sync",
76 ],
Brian Silverman100534c2015-09-07 15:51:23 -040077)
78
79cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080080 name = "queue",
81 srcs = [
82 "queue.cc",
83 ],
84 hdrs = [
85 "queue.h",
86 ],
Brian Silverman7a7c24d2018-09-01 17:49:09 -070087 compatible_with = [
88 "//tools:armhf-debian",
89 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080090 linkopts = [
91 "-lrt",
92 ],
93 deps = [
94 ":core_lib",
95 ":shared_mem",
John Park33858a32018-09-28 23:05:48 -070096 "//aos:condition",
97 "//aos/mutex:mutex",
98 "//aos/logging",
99 "//aos/util:options",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800100 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400101)
102
103cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800104 name = "raw_queue_test",
105 srcs = [
106 "raw_queue_test.cc",
107 ],
108 deps = [
109 ":core_lib",
110 ":queue",
John Park33858a32018-09-28 23:05:48 -0700111 "//aos:die",
112 "//aos/time:time",
113 "//aos/logging",
114 "//aos/util:death_test_log_implementation",
115 "//aos/util:thread",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800116 "//aos/testing:googletest",
117 "//aos/testing:prevent_exit",
118 "//aos/testing:test_shm",
119 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400120)
121
122cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800123 name = "ipc_stress_test",
124 srcs = [
125 "ipc_stress_test.cc",
126 ],
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700127 compatible_with = [
128 "//tools:armhf-debian",
129 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800130 tags = [
131 "manual",
132 ],
133 deps = [
134 ":core_lib",
John Park33858a32018-09-28 23:05:48 -0700135 "//aos:die",
136 "//aos/mutex:mutex",
137 "//aos/time:time",
138 "//aos/libc:aos_strsignal",
139 "//aos/libc:dirname",
140 "//aos/logging",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800141 "//aos/testing:googletest",
142 "//aos/testing:test_shm",
143 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400144)
145
146cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800147 name = "scoped_message_ptr",
148 deps = [
149 ":queue",
150 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400151)
Brian Silvermane4d8b282015-12-24 13:44:48 -0800152
153cc_binary(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800154 name = "ipc_comparison",
155 srcs = [
156 "ipc_comparison.cc",
157 ],
158 deps = [
159 ":queue",
John Park33858a32018-09-28 23:05:48 -0700160 "//aos:condition",
161 "//aos:event",
162 "//aos/mutex:mutex",
163 "//aos/logging",
164 "//aos/logging:implementations",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800165 "//aos/linux_code:init",
166 "//third_party/gflags",
167 ],
Brian Silvermane4d8b282015-12-24 13:44:48 -0800168)