blob: 8b8686d1fd9a9a93d1b25fbfd4674035a9b9a376 [file] [log] [blame]
Brian Silverman100534c2015-09-07 15:51:23 -04001package(default_visibility = ['//visibility:public'])
2
3cc_library(
4 name = 'aos_sync',
5 srcs = [
6 'aos_sync.cc',
7 ],
8 hdrs = [
9 'aos_sync.h',
10 ],
Brian Silvermand1c19fb2016-07-07 00:10:57 -070011 linkopts = [
12 '-pthread',
13 ],
Brian Silverman100534c2015-09-07 15:51:23 -040014 deps = [
Brian Silvermancb5da1f2015-12-05 22:19:58 -050015 '//aos/common/logging',
Sabina Davis2ed5ea22017-09-26 22:27:42 -070016 '//aos:once',
Austin Schuh044e18b2015-10-21 20:17:09 -070017 '//aos/common:macros',
Brian Silverman71c55c52014-08-19 14:31:59 -040018 '//aos/common/util:compiler_memory_barrier',
Brian Silverman100534c2015-09-07 15:51:23 -040019 ],
20)
21
22cc_library(
23 name = 'core_lib',
24 srcs = [
25 'core_lib.c',
26 ],
27 hdrs = [
28 'core_lib.h',
29 ],
30 deps = [
31 ':aos_sync',
Austin Schuh044e18b2015-10-21 20:17:09 -070032 ':shared_mem_types',
Brian Silverman100534c2015-09-07 15:51:23 -040033 ],
34)
35
36cc_library(
37 name = 'shared_mem',
38 srcs = [
39 'shared_mem.c',
40 ],
41 hdrs = [
42 'shared_mem.h',
43 ],
44 deps = [
45 ':aos_sync',
Austin Schuh044e18b2015-10-21 20:17:09 -070046 ':core_lib',
47 ':shared_mem_types',
Brian Silvermancb5da1f2015-12-05 22:19:58 -050048 '//aos/common/logging',
Philipp Schraderb3a057e2018-03-10 18:59:40 -080049 ],
50 linkopts = [
51 '-lrt',
Austin Schuh044e18b2015-10-21 20:17:09 -070052 ],
53)
54
55cc_library(
56 # 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',
Brian Silverman100534c2015-09-07 15:51:23 -040064 ],
65)
66
67cc_library(
68 name = 'queue',
69 srcs = [
70 'queue.cc',
71 ],
72 hdrs = [
73 'queue.h',
74 ],
75 deps = [
Brian Silverman2200b2c2015-11-29 05:59:28 +000076 '//aos/common:condition',
77 '//aos/common:mutex',
Brian Silverman100534c2015-09-07 15:51:23 -040078 ':core_lib',
Austin Schuh044e18b2015-10-21 20:17:09 -070079 ':shared_mem',
Brian Silvermancb5da1f2015-12-05 22:19:58 -050080 '//aos/common/logging',
Austin Schuh044e18b2015-10-21 20:17:09 -070081 '//aos/common/util:options',
Brian Silverman100534c2015-09-07 15:51:23 -040082 ],
Philipp Schraderb3a057e2018-03-10 18:59:40 -080083 linkopts = [
84 '-lrt',
85 ],
Brian Silverman100534c2015-09-07 15:51:23 -040086)
87
88cc_test(
89 name = 'raw_queue_test',
90 srcs = [
91 'raw_queue_test.cc',
92 ],
93 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -040094 '//aos/testing:googletest',
Brian Silvermanf5f8d8e2015-12-06 18:39:12 -050095 '//aos/testing:prevent_exit',
Brian Silverman100534c2015-09-07 15:51:23 -040096 ':queue',
97 '//aos/common/logging',
98 ':core_lib',
Brian Silvermanf5f8d8e2015-12-06 18:39:12 -050099 '//aos/testing:test_shm',
Brian Silverman100534c2015-09-07 15:51:23 -0400100 '//aos/common:time',
101 '//aos/common:die',
102 '//aos/common/util:thread',
103 '//aos/common/util:death_test_log_implementation',
104 ],
105)
106
107cc_test(
108 name = 'ipc_stress_test',
109 srcs = [
110 'ipc_stress_test.cc',
111 ],
112 tags = [
113 'manual',
114 ],
115 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400116 '//aos/testing:googletest',
Brian Silverman100534c2015-09-07 15:51:23 -0400117 '//aos/common:time',
Brian Silvermanf5f8d8e2015-12-06 18:39:12 -0500118 '//aos/testing:test_shm',
Brian Silverman2200b2c2015-11-29 05:59:28 +0000119 '//aos/common:mutex',
Brian Silverman100534c2015-09-07 15:51:23 -0400120 ':core_lib',
121 '//aos/common:die',
122 '//aos/common/libc:dirname',
123 '//aos/common/libc:aos_strsignal',
124 '//aos/common/logging',
125 ],
126)
127
128cc_library(
129 name = 'scoped_message_ptr',
130 deps = [
131 ':queue',
132 ],
133)
Brian Silvermane4d8b282015-12-24 13:44:48 -0800134
135cc_binary(
136 name = 'ipc_comparison',
137 srcs = [
138 'ipc_comparison.cc',
139 ],
140 deps = [
141 '//aos/common:mutex',
142 '//aos/common:event',
143 '//aos/common:condition',
144 '//third_party/gflags',
145 '//aos/common/logging',
146 '//aos/common/logging:implementations',
147 '//aos/linux_code:init',
148 ':queue',
149 ],
150)