blob: 138ba4bb1551603b049ea3e2ad9d182cb39e2d40 [file] [log] [blame]
Igor Murashkin75f93632018-09-25 17:54:09 -07001// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15filegroup {
16 name: "iorap-aidl",
17 srcs: [
18 // note: using **/* doesn't work, so list each file one by one:
19 // see also b/70046217
20
21 // note: list only 'interface' aidl files, otherwise
22 // aidl generates an error "Refusing to generate code with unstructured parcelables."
23 "binder/com/google/android/startop/iorap/IIorap.aidl",
24 "binder/com/google/android/startop/iorap/ITaskListener.aidl",
25 ],
Dan Willemsenf7752842019-06-04 16:19:35 -070026 path: "binder",
Igor Murashkin75f93632018-09-25 17:54:09 -070027}
Igor Murashkin6d0699b2018-09-28 16:44:48 -070028
29cc_defaults {
30 name: "iorap-default-flags",
31
32 cflags: [
33 "-Wall",
34 "-Werror",
35 "-Wextra",
36 "-Wno-missing-field-initializers",
37 "-Wno-unused-parameter",
38 "-Wno-unused-variable",
39 ],
40
41 local_include_dirs: [
42 "include",
43 "src",
44 ],
45 // TODO: shouldn't need this but there's a soong/cmake generator bug.
46 export_include_dirs: [
47 "include",
48 "src",
49 ],
50
Igor Murashkine54aebc2019-01-22 17:58:51 -080051 /*
52 TODO: Header refactoring cleanup:
53
54 Option 1): Move src/$component/file_name.h to src/$component/include/$component/file_name.h
55 Option 2): Symlink src/$component/include/$component to src/$component
56
57 Set export_include_dirs to '$component/include' for that component.
58
59 Also delete the 'include' directory unless we have code other non-iorap
60 targets are allowed to reference.
61 */
62
Igor Murashkin6d0699b2018-09-28 16:44:48 -070063 clang: true,
Yan Wangd40dac32019-11-21 16:46:40 -080064 static_libs: ["libc++fs"],
Igor Murashkin6d0699b2018-09-28 16:44:48 -070065 shared_libs: ["libbase"],
Igor Murashkin2f113402019-09-24 13:14:02 -070066
67 // build all ioraps for host.
68 host_supported: true,
Igor Murashkin6d0699b2018-09-28 16:44:48 -070069}
70
71cc_defaults {
72 name: "iorap-default-dependencies",
73
74 static_libs: [
75 "libiorap-binder",
Igor Murashkinb250cd82019-01-09 11:33:52 -080076 "libplatformprotos", // android framework C++ protos.
Igor Murashkin6d0699b2018-09-28 16:44:48 -070077 ],
78 shared_libs: [
Igor Murashkin6d0699b2018-09-28 16:44:48 -070079 "libbinder",
80 "libutils",
81 "libcutils", // tracing.
82
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -080083 "libfruit", // dependency injection.
Igor Murashkin6d0699b2018-09-28 16:44:48 -070084 // TODO: remove these annoying dependencies by hiding them in the main library code.
Igor Murashkinb250cd82019-01-09 11:33:52 -080085
86 // dependency for libplatformprotos
87 // "libprotobuf-cpp-lite",
88
89 // libplatformprotos has an indirect dependency on full, causing compilation/linking
90 // errors if we use lite
91 "libprotobuf-cpp-full",
Mathieu Chartier0280cda2019-12-03 13:28:25 -080092
93 // phenotype flags support
94 "server_configurable_flags",
Igor Murashkin6d0699b2018-09-28 16:44:48 -070095 ],
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -080096
Igor Murashkinb250cd82019-01-09 11:33:52 -080097 // srcs: [":libprotobuf-internal-protos"],
98 // commented out because it causes compilation errors
99 // TODO: can we use the lite library somehow?
100
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -0800101 header_libs: ["librxcpp"],
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700102}
103
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700104cc_library_static {
105 name: "libiorap-binder",
106 defaults: ["iorap-default-flags"],
107
108 srcs: [
109 ":iorap-aidl",
110 "src/binder/iiorap_impl.cc",
Yan Wang3a8d95e2020-03-05 10:40:31 -0800111 "src/binder/package_change_observer.cc",
Yan Wang16b8fce2020-02-20 18:08:33 +0000112 "src/binder/package_manager_remote.cc",
113 "src/binder/package_version_map.cc",
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700114 ],
115 shared_libs: [
116 "libbinder",
117 "libutils",
118 "libcutils", // tracing.
119 ],
120 aidl: {
121 local_include_dirs: ["binder"],
122 include_dirs: ["frameworks/native/aidl/binder"],
123 export_aidl_headers: true,
124 },
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800125
Igor Murashkine54aebc2019-01-22 17:58:51 -0800126 static_libs: [
127 "libplatformprotos", // android framework C++ protos.
128 ],
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700129}
130
Igor Murashkinb250cd82019-01-09 11:33:52 -0800131cc_defaults {
132 name: "libiorap-manager-default-dependencies",
133 static_libs: [
Yan Wang16b8fce2020-02-20 18:08:33 +0000134 "libiorap-binder",
Igor Murashkinb250cd82019-01-09 11:33:52 -0800135 "libiorap-perfetto",
Igor Murashkinf2e01062019-04-12 15:57:55 -0700136 "libiorap-prefetcher",
Igor Murashkin03e5b052019-10-03 16:39:50 -0700137 "libiorap-db",
Yan Wange16e9632019-11-27 16:33:55 -0800138 "libiorap-maintenance",
Igor Murashkinb250cd82019-01-09 11:33:52 -0800139 ],
140 defaults: [
141 "libiorap-perfetto-default-dependencies",
Igor Murashkinf2e01062019-04-12 15:57:55 -0700142 "libiorap-prefetcher-default-dependencies",
Igor Murashkin03e5b052019-10-03 16:39:50 -0700143 "libiorap-db-default-dependencies",
Igor Murashkinb250cd82019-01-09 11:33:52 -0800144 ],
145 // Users of 'libiorap-manager' also need to include these defaults to avoid
146 // linking errors.
147}
148
149cc_library_static {
150 name: "libiorap-manager",
151 defaults: [
152 "iorap-default-flags",
153 "iorap-default-dependencies",
154 "libiorap-manager-default-dependencies",
155 ],
156
157 srcs: [
Colin Cross5221ec32019-05-22 11:13:25 -0700158 "src/manager/**/*.cc",
Igor Murashkinb250cd82019-01-09 11:33:52 -0800159 ],
160}
161
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700162cc_binary {
163 name: "iorapd",
164 defaults: [
165 "iorap-default-flags",
166 "iorap-default-dependencies",
Igor Murashkine54aebc2019-01-22 17:58:51 -0800167 "libiorap-manager-default-dependencies",
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700168 ],
169 srcs: [
170 "src/iorapd/main.cc",
171 ],
Igor Murashkine54aebc2019-01-22 17:58:51 -0800172 static_libs: [
173 "libiorap-manager",
174 ],
Igor Murashkin32b6a882018-10-05 16:27:35 -0700175 init_rc: [
176 "iorapd.rc",
177 ],
Yan Wang393667b2020-01-09 09:08:35 -0800178 // iorapd fork+execs into iorap.prefetcherd and iorap.cmd.compiler
Igor Murashkina35242b2020-03-11 13:28:51 -0700179 // maintenance used by tests
Igor Murashkin7097bfc2019-09-05 10:37:59 -0700180 required: [
Yan Wang393667b2020-01-09 09:08:35 -0800181 "iorap.cmd.compiler",
Igor Murashkin7097bfc2019-09-05 10:37:59 -0700182 "iorap.prefetcherd",
Igor Murashkina35242b2020-03-11 13:28:51 -0700183 "iorap.cmd.maintenance",
Igor Murashkin7097bfc2019-09-05 10:37:59 -0700184 ],
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700185}
186
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -0800187cc_library_static {
188 name: "libiorap-inode2filename",
189 defaults: [
190 "iorap-default-flags",
191 "iorap-default-dependencies",
192 ],
193
194 srcs: [
195 "src/inode2filename/**/*.cc",
196 ],
197}
198
199cc_binary {
200 name: "iorap.inode2filename",
201 defaults: [
202 "iorap-default-flags",
203 "iorap-default-dependencies",
204 ],
205 srcs: [
206 "src/inode2filename/**/*.cc",
207 ],
208 // Easier debugging. TODO: make a separate debug config.
209 // XX: Using -O0 seems to completely hide some errors.
210 cflags: ["-O2", "-UNDEBUG", "-DIORAP_INODE2FILENAME_MAIN=1"],
211 sanitize: {
212 undefined: true,
213 all_undefined: true,
214 // Pretty print when ubsan detects a problem.
215 // Otherwise it just calls abort().
216
217/*
218 diag: {
219 undefined: true,
220 },
221 */ // don't use the diag when you want it to crash.
222 },
223}
224
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700225cc_test {
226 name: "iorapd-tests",
Igor Murashkina4d89f52018-10-09 15:00:20 -0700227 test_suites: ["device-tests"],
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -0800228 gtest: false, // we use gtest *and* gmock.
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700229 defaults: [
230 "iorap-default-flags",
231 "iorap-default-dependencies",
Yan Wanga1123fb2019-10-15 15:24:54 -0700232 "libiorap-compiler-default-dependencies",
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700233 ],
234 srcs: [
Yan Wanga1123fb2019-10-15 15:24:54 -0700235 "tests/src/binder/*.cc",
236 "tests/src/inode2filename/*.cc",
237 "tests/src/log/*.cc",
238 "tests/src/tmp/*.cc",
239 ],
240 data: [
241 "tests/src/compiler/testdata/*",
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700242 ],
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -0800243 cflags: ["-O2", "-UNDEBUG"],
Igor Murashkine54aebc2019-01-22 17:58:51 -0800244
245 // TODO: we should probably have per-component tests.
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -0800246 static_libs: ["libgmock_main", "libgmock", "libgtest", "libiorap-inode2filename"],
Yan Wanga1123fb2019-10-15 15:24:54 -0700247
248}
249
250
251cc_test_host {
252 name: "iorapd-host-tests",
Yan Wanga1123fb2019-10-15 15:24:54 -0700253 gtest: false, // we use gtest *and* gmock.
254 defaults: [
255 "iorap-default-flags",
256 "iorap-default-dependencies",
257 "libiorap-compiler-default-dependencies",
Yan Wang65e905d2019-11-16 14:49:56 -0800258 "libiorap-maintenance-default-dependencies",
Yan Wanga1123fb2019-10-15 15:24:54 -0700259 ],
260 srcs: [
261 "tests/src/compiler/*.cc",
Yan Wangd40dac32019-11-21 16:46:40 -0800262 "tests/src/db/*.cc",
Yan Wang65e905d2019-11-16 14:49:56 -0800263 "tests/src/maintenance/*.cc",
Yan Wanga1123fb2019-10-15 15:24:54 -0700264 ],
265 data: [
266 "tests/src/compiler/testdata/*",
Yan Wang65e905d2019-11-16 14:49:56 -0800267 "tests/src/maintenance/testdata/*",
Yan Wanga1123fb2019-10-15 15:24:54 -0700268 ],
269 cflags: ["-O2", "-UNDEBUG"],
270
271 // TODO: we should probably have per-component tests.
Yan Wang65e905d2019-11-16 14:49:56 -0800272 static_libs: [
273 "libgmock_main",
274 "libgmock",
275 "libgtest",
276 "libiorap-compiler",
277 "libiorap-maintenance",
278 ],
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700279}
Igor Murashkinb250cd82019-01-09 11:33:52 -0800280
281filegroup {
282 name: "libiorap-perfetto-protos",
283 srcs: [
284 ],
285}
286
287// Static libraries cannot export their dependencies,
288// the current convention is to use an extra 'defaults' rule for statics
289// to bring in all the dependencies.
290cc_defaults {
291 name: "libiorap-perfetto-default-dependencies",
292
293 // Some of the libperfetto header typedefs leak out into iorap.
294 // Avoids compilation #include errors.
295 // TODO: clean this up, the headers should not leak out (maybe all we need is a PerfettoConsumer
296 // forward declaration?).
297 include_dirs: ["external/perfetto/include"],
298 // Various perfetto protos are used directly by iorap.
299 //
300 // Furthermore, we need this regardless to avoid linking errors when linking
301 // libiorap-perfetto.a into the main cc_binary rule.
302 static_libs: [
303 "perfetto_trace_protos",
304 ],
305
306 shared_libs: [
307 // Not part of true dependencies: Users of 'libiorap-perfetto' do not link against
308 // libperfetto.
309 // We only put this to avoid linking errors when building iorapd.
310 // TODO: can we split iorapd into libiorapd-main that doesn't link against libperfetto?
311 // only the last cc_binary should need the full transitive closure of the dependency graph.
312 "libperfetto",
313 ]
314}
315
316cc_library_static {
317 name: "libiorap-perfetto",
318 defaults: [
319 "iorap-default-flags",
320 "iorap-default-dependencies",
321 "libiorap-perfetto-default-dependencies",
322 ],
323
324 srcs: [
325 "src/perfetto/**/*.cc",
326 ],
327}
328
329cc_binary {
330 name: "iorap.cmd.perfetto",
331 defaults: [
332 "iorap-default-flags",
333 "iorap-default-dependencies",
334 ],
335 shared_libs: ["libperfetto"],
336 include_dirs: ["external/perfetto/include"],
337 srcs: [
338 "src/perfetto/**/*.cc",
339 ],
340 // Easier debugging. TODO: make a separate debug config.
341 // XX: Using -O0 seems to completely hide some errors.
342 cflags: ["-O2", "-UNDEBUG", "-DIORAP_PERFETTO_MAIN=1"],
343 sanitize: {
344 undefined: true,
345 all_undefined: true,
346 // Pretty print when ubsan detects a problem.
347 // Otherwise it just calls abort().
348
349/*
350 diag: {
351 undefined: true,
352 },
353 */ // don't use the diag when you want it to crash.
354 },
355
356 static_libs: [
357 "perfetto_trace_protos",
358 ],
359}
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800360
361// Static libraries cannot export their dependencies,
362// the current convention is to use an extra 'defaults' rule for statics
363// to bring in all the dependencies.
364cc_defaults {
365 name: "libiorap-compiler-default-dependencies",
366
367 defaults: [
368 // use the perfetto namespace
Igor Murashkinb6bce832019-04-10 15:46:06 -0700369 "libiorap-perfetto-default-dependencies",
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800370 // use the inode2filename namespace
Igor Murashkinb6bce832019-04-10 15:46:06 -0700371 "libiorap-serialize-default-dependencies", // uses but does not re-export serialize.
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800372 ],
373
374 // Some of the libperfetto header typedefs leak out into iorap.
375 // Avoids compilation #include errors.
376 // TODO: clean this up, the headers should not leak out (maybe all we need is a PerfettoConsumer
377 // forward declaration?).
378 include_dirs: [],
379 // Various perfetto protos are used directly by iorap.
380 //
381 // Furthermore, we need this regardless to avoid linking errors when linking
382 // libiorap-compiler.a into the main cc_binary rule.
383 static_libs: [
384 "libiorap-perfetto",
385 // "perfetto_trace_protos",
386 "libiorap-inode2filename",
Igor Murashkinb6bce832019-04-10 15:46:06 -0700387 "libiorap-serialize",
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800388 ],
389
390 shared_libs: [
391 // Not part of true dependencies: Users of 'libiorap-compiler' do not link against
392 // libperfetto.
393 // We only put this to avoid linking errors when building iorapd.
394 // TODO: can we split iorapd into libiorapd-main that doesn't link against libperfetto?
395 // only the last cc_binary should need the full transitive closure of the dependency graph.
396 ]
397}
398
399cc_library_static {
400 name: "libiorap-compiler",
401 defaults: [
402 "iorap-default-flags",
403 "iorap-default-dependencies",
404 "libiorap-compiler-default-dependencies",
405 ],
406
407 srcs: [
408 "src/compiler/**/*.cc",
409 ],
410}
411
412cc_binary {
413 name: "iorap.cmd.compiler",
414 defaults: [
415 "iorap-default-flags",
416 "iorap-default-dependencies",
417 "libiorap-compiler-default-dependencies",
418 ],
419 shared_libs: [],
420 include_dirs: [],
421 srcs: [
422 "src/compiler/**/*.cc",
423 ],
424 // Easier debugging. TODO: make a separate debug config.
425 // XX: Using -O0 seems to completely hide some errors.
426 cflags: ["-O2", "-UNDEBUG", "-DIORAP_COMPILER_MAIN=1"],
427 sanitize: {
428 undefined: true,
429 all_undefined: true,
430 // Pretty print when ubsan detects a problem.
431 // Otherwise it just calls abort().
432
433/*
434 diag: {
435 undefined: true,
436 },
437 */ // don't use the diag when you want it to crash.
438 },
439
440 static_libs: [
441 ],
Igor Murashkind8fe2042020-02-18 12:54:31 -0800442 required: [
443 "iorap.inode2filename",
444 ],
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800445}
Igor Murashkine75557d2019-04-08 15:42:50 -0700446
447// Static libraries cannot export their dependencies,
448// the current convention is to use an extra 'defaults' rule for statics
449// to bring in all the dependencies.
450cc_defaults {
451 name: "libiorap-serialize-default-dependencies",
452
453 defaults: [
454 ],
455
456 include_dirs: [],
457 static_libs: [
458 ],
459 shared_libs: [
Igor Murashkinb6bce832019-04-10 15:46:06 -0700460 ],
Igor Murashkine75557d2019-04-08 15:42:50 -0700461 // Above intentionally left empty.
Igor Murashkinb6bce832019-04-10 15:46:06 -0700462 srcs: [
463 "src/serialize/**/*.proto",
464 ],
Igor Murashkine75557d2019-04-08 15:42:50 -0700465}
466
467cc_library_static {
468 name: "libiorap-serialize",
469 defaults: [
470 "iorap-default-flags",
471 "iorap-default-dependencies",
472 "libiorap-serialize-default-dependencies",
473 ],
474
475 srcs: [
476 "src/serialize/**/*.cc",
Igor Murashkine75557d2019-04-08 15:42:50 -0700477 ],
478}
Igor Murashkin6d5c27f2019-04-11 15:34:13 -0700479
480
481// Static libraries cannot export their dependencies,
482// the current convention is to use an extra 'defaults' rule for statics
483// to bring in all the dependencies.
484cc_defaults {
485 name: "libiorap-prefetcher-default-dependencies",
486
487 defaults: [
488 ],
489
490 include_dirs: [],
491 static_libs: [
492 "libiorap-serialize",
493 ],
494 shared_libs: [
Igor Murashkin05134882019-11-11 12:40:17 -0800495 "libminijail",
Igor Murashkin6d5c27f2019-04-11 15:34:13 -0700496 ],
Igor Murashkin6f4fac72019-11-21 14:31:12 -0800497
498 // disable mac builds because libminijail doesn't work there
499 target: {
500 darwin: {
501 enabled: false,
502 },
503 },
Igor Murashkin6d5c27f2019-04-11 15:34:13 -0700504}
505
506cc_library_static {
507 name: "libiorap-prefetcher",
508 defaults: [
509 "iorap-default-flags",
510 "iorap-default-dependencies",
511 "libiorap-prefetcher-default-dependencies",
512 "libiorap-serialize-default-dependencies",
513 ],
514
515 srcs: [
516 "src/prefetcher/**/*.cc",
517 ],
518}
Igor Murashkin7097bfc2019-09-05 10:37:59 -0700519
520cc_binary {
521 name: "iorap.prefetcherd",
522 defaults: [
523 "iorap-default-flags",
524 "iorap-default-dependencies",
525 "libiorap-prefetcher-default-dependencies",
526 "libiorap-serialize-default-dependencies",
527 ],
528 shared_libs: [],
529 include_dirs: [],
530 srcs: [
531 "src/prefetcher/**/*.cc",
532 ],
533 // Easier debugging. TODO: make a separate debug config.
534 // XX: Using -O0 seems to completely hide some errors.
535 cflags: ["-O2", "-UNDEBUG", "-DIORAP_PREFETCHER_MAIN=1"],
536 sanitize: {
537 undefined: true,
538 all_undefined: true,
539 // Pretty print when ubsan detects a problem.
540 // Otherwise it just calls abort().
541
542/*
543 diag: {
544 undefined: true,
545 },
546 */ // don't use the diag when you want it to crash.
547 },
548
549 static_libs: [
550 ],
551}
552
Igor Murashkin6c3686a2019-09-12 15:37:02 -0700553cc_binary {
554 name: "iorap.cmd.prefetcher.client",
555 defaults: [
556 "iorap-default-flags",
557 "iorap-default-dependencies",
558 "libiorap-prefetcher-default-dependencies",
559 "libiorap-serialize-default-dependencies",
560 ],
561 shared_libs: [],
562 include_dirs: [],
563 srcs: [
564 "src/prefetcher/**/*.cc",
565 ],
566 // Easier debugging. TODO: make a separate debug config.
567 // XX: Using -O0 seems to completely hide some errors.
568 cflags: ["-O2", "-UNDEBUG", "-DIORAP_PREFETCHER_MAIN_CLIENT=1"],
569 sanitize: {
570 undefined: true,
571 all_undefined: true,
572 // Pretty print when ubsan detects a problem.
573 // Otherwise it just calls abort().
Igor Murashkin7097bfc2019-09-05 10:37:59 -0700574
Igor Murashkin6c3686a2019-09-12 15:37:02 -0700575/*
576 diag: {
577 undefined: true,
578 },
579 */ // don't use the diag when you want it to crash.
580 },
581
582 static_libs: [
583 ],
584}
Igor Murashkin03e5b052019-10-03 16:39:50 -0700585
Igor Murashkin05134882019-11-11 12:40:17 -0800586prebuilt_etc {
587 name: "iorap.prefetcherd.policy",
588 sub_dir: "seccomp_policy",
589 arch: {
590 arm: {
591 src: "seccomp_policy/prefetcherd.arm.policy"
592 },
593 arm64: {
594 src: "seccomp_policy/prefetcherd.arm64.policy"
595 },
596 x86: {
597 src: "seccomp_policy/prefetcherd.x86.policy"
598 },
599 x86_64: {
600 src: "seccomp_policy/prefetcherd.x86_64.policy"
601 },
602 },
603 required: [
604 "crash_dump.policy",
605 ],
606}
607
Igor Murashkin03e5b052019-10-03 16:39:50 -0700608// Static libraries cannot export their dependencies,
609// the current convention is to use an extra 'defaults' rule for statics
610// to bring in all the dependencies.
611cc_defaults {
612 name: "libiorap-db-default-dependencies",
613
614 defaults: [
615 ],
616
617 include_dirs: [],
618 static_libs: [
619 ],
620 shared_libs: [
621 "libsqlite",
622 ],
623}
624
625cc_library_static {
626 name: "libiorap-db",
627 defaults: [
628 "iorap-default-flags",
629 "iorap-default-dependencies",
630 "libiorap-db-default-dependencies",
631 ],
632
633 srcs: [
634 "src/db/**/*.cc",
635 ],
636}
637
638cc_binary {
639 name: "iorap.cmd.db",
640 defaults: [
641 "iorap-default-flags",
642 "iorap-default-dependencies",
643 "libiorap-db-default-dependencies",
644 ],
645 shared_libs: [],
646 include_dirs: [],
647 srcs: [
648 "src/db/**/*.cc",
649 ],
650 // Easier debugging. TODO: make a separate debug config.
651 // XX: Using -O0 seems to completely hide some errors.
652 cflags: ["-O2", "-UNDEBUG", "-DIORAP_DB_MAIN=1"],
653 sanitize: {
654 undefined: true,
655 all_undefined: true,
656 // Pretty print when ubsan detects a problem.
657 // Otherwise it just calls abort().
658
659/*
660 diag: {
661 undefined: true,
662 },
663 */ // don't use the diag when you want it to crash.
664 },
665
666 static_libs: [
667 ],
668}
Yan Wangcdb97fa2019-10-18 18:18:48 -0700669
670cc_defaults {
671 name: "libiorap-maintenance-default-dependencies",
672
673 defaults: [
674 "libiorap-compiler-default-dependencies",
675 "libiorap-db-default-dependencies",
Igor Murashkin0a7cb8c2020-03-03 15:57:05 -0800676 "libiorap-prefetcher-default-dependencies",
Yan Wangcdb97fa2019-10-18 18:18:48 -0700677 ],
678
679 include_dirs: [],
680
681 static_libs: [
Yan Wang16b8fce2020-02-20 18:08:33 +0000682 "libiorap-binder",
Yan Wangcdb97fa2019-10-18 18:18:48 -0700683 "libiorap-compiler",
684 "libiorap-db",
Igor Murashkin0a7cb8c2020-03-03 15:57:05 -0800685 "libiorap-prefetcher",
Yan Wangcdb97fa2019-10-18 18:18:48 -0700686 ],
687
688 shared_libs: []
689}
690
691cc_library_static {
692 name: "libiorap-maintenance",
693 defaults: [
694 "iorap-default-flags",
695 "iorap-default-dependencies",
696 "libiorap-maintenance-default-dependencies",
697 ],
698
699 srcs: [
700 "src/maintenance/*.cc",
701 ],
702}
703
704cc_binary {
705 name: "iorap.cmd.maintenance",
706 defaults: [
707 "iorap-default-flags",
708 "iorap-default-dependencies",
709 "libiorap-maintenance-default-dependencies",
710 ],
711 shared_libs: [],
712 include_dirs: [],
713 srcs: [
714 "src/maintenance/*.cc",
715 ],
716 cflags: ["-O2", "-UNDEBUG", "-DIORAP_MAINTENANCE_MAIN=1"],
717 sanitize: {
718 undefined: true,
719 all_undefined: true,
720
721 diag: {
722 undefined: true,
723 },
724 },
725
726 static_libs: [],
727}