blob: d5d2c8d5229ae6556613621d55b2bae0ee830e7c [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 ],
11 linkopts = [
12 "-lpthread",
13 ],
14 deps = [
15 "//aos:once",
16 "//aos/common:macros",
17 "//aos/common/logging",
18 "//aos/common/util:compiler_memory_barrier",
19 ],
Brian Silverman100534c2015-09-07 15:51:23 -040020)
21
22cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080023 name = "core_lib",
24 srcs = [
25 "core_lib.c",
26 ],
27 hdrs = [
28 "core_lib.h",
29 ],
30 deps = [
31 ":aos_sync",
32 ":shared_mem_types",
33 ],
Brian Silverman100534c2015-09-07 15:51:23 -040034)
35
36cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080037 name = "shared_mem",
38 srcs = [
39 "shared_mem.c",
40 ],
41 hdrs = [
42 "shared_mem.h",
43 ],
44 linkopts = [
45 "-lrt",
46 ],
47 deps = [
48 ":aos_sync",
49 ":core_lib",
50 ":shared_mem_types",
51 "//aos/common/logging",
52 ],
Austin Schuh044e18b2015-10-21 20:17:09 -070053)
54
55cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080056 # TODO(Brian): This should be shared_mem{,.h}, and the other one should be
57 # shared_mem_init{,.cc,.h}.
58 name = "shared_mem_types",
59 hdrs = [
60 "shared_mem_types.h",
61 ],
62 deps = [
63 ":aos_sync",
64 ],
Brian Silverman100534c2015-09-07 15:51:23 -040065)
66
67cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080068 name = "queue",
69 srcs = [
70 "queue.cc",
71 ],
72 hdrs = [
73 "queue.h",
74 ],
75 linkopts = [
76 "-lrt",
77 ],
78 deps = [
79 ":core_lib",
80 ":shared_mem",
81 "//aos/common:condition",
82 "//aos/common:mutex",
83 "//aos/common/logging",
84 "//aos/common/util:options",
85 ],
Brian Silverman100534c2015-09-07 15:51:23 -040086)
87
88cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080089 name = "raw_queue_test",
90 srcs = [
91 "raw_queue_test.cc",
92 ],
93 deps = [
94 ":core_lib",
95 ":queue",
96 "//aos/common:die",
97 "//aos/common:time",
98 "//aos/common/logging",
99 "//aos/common/util:death_test_log_implementation",
100 "//aos/common/util:thread",
101 "//aos/testing:googletest",
102 "//aos/testing:prevent_exit",
103 "//aos/testing:test_shm",
104 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400105)
106
107cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800108 name = "ipc_stress_test",
109 srcs = [
110 "ipc_stress_test.cc",
111 ],
112 tags = [
113 "manual",
114 ],
115 deps = [
116 ":core_lib",
117 "//aos/common:die",
118 "//aos/common:mutex",
119 "//aos/common:time",
120 "//aos/common/libc:aos_strsignal",
121 "//aos/common/libc:dirname",
122 "//aos/common/logging",
123 "//aos/testing:googletest",
124 "//aos/testing:test_shm",
125 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400126)
127
128cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800129 name = "scoped_message_ptr",
130 deps = [
131 ":queue",
132 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400133)
Brian Silvermane4d8b282015-12-24 13:44:48 -0800134
135cc_binary(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800136 name = "ipc_comparison",
137 srcs = [
138 "ipc_comparison.cc",
139 ],
140 deps = [
141 ":queue",
142 "//aos/common:condition",
143 "//aos/common:event",
144 "//aos/common:mutex",
145 "//aos/common/logging",
146 "//aos/common/logging:implementations",
147 "//aos/linux_code:init",
148 "//third_party/gflags",
149 ],
Brian Silvermane4d8b282015-12-24 13:44:48 -0800150)