blob: e8ef332d643cb82c036f6fd809e07b4d659d81a1 [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 Wang16b8fce2020-02-20 18:08:33 +0000111 "src/binder/package_manager_remote.cc",
112 "src/binder/package_version_map.cc",
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700113 ],
114 shared_libs: [
115 "libbinder",
116 "libutils",
117 "libcutils", // tracing.
118 ],
119 aidl: {
120 local_include_dirs: ["binder"],
121 include_dirs: ["frameworks/native/aidl/binder"],
122 export_aidl_headers: true,
123 },
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800124
Igor Murashkine54aebc2019-01-22 17:58:51 -0800125 static_libs: [
126 "libplatformprotos", // android framework C++ protos.
127 ],
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700128}
129
Igor Murashkinb250cd82019-01-09 11:33:52 -0800130cc_defaults {
131 name: "libiorap-manager-default-dependencies",
132 static_libs: [
Yan Wang16b8fce2020-02-20 18:08:33 +0000133 "libiorap-binder",
Igor Murashkinb250cd82019-01-09 11:33:52 -0800134 "libiorap-perfetto",
Igor Murashkinf2e01062019-04-12 15:57:55 -0700135 "libiorap-prefetcher",
Igor Murashkin03e5b052019-10-03 16:39:50 -0700136 "libiorap-db",
Yan Wange16e9632019-11-27 16:33:55 -0800137 "libiorap-maintenance",
Igor Murashkinb250cd82019-01-09 11:33:52 -0800138 ],
139 defaults: [
140 "libiorap-perfetto-default-dependencies",
Igor Murashkinf2e01062019-04-12 15:57:55 -0700141 "libiorap-prefetcher-default-dependencies",
Igor Murashkin03e5b052019-10-03 16:39:50 -0700142 "libiorap-db-default-dependencies",
Igor Murashkinb250cd82019-01-09 11:33:52 -0800143 ],
144 // Users of 'libiorap-manager' also need to include these defaults to avoid
145 // linking errors.
146}
147
148cc_library_static {
149 name: "libiorap-manager",
150 defaults: [
151 "iorap-default-flags",
152 "iorap-default-dependencies",
153 "libiorap-manager-default-dependencies",
154 ],
155
156 srcs: [
Colin Cross5221ec32019-05-22 11:13:25 -0700157 "src/manager/**/*.cc",
Igor Murashkinb250cd82019-01-09 11:33:52 -0800158 ],
159}
160
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700161cc_binary {
162 name: "iorapd",
163 defaults: [
164 "iorap-default-flags",
165 "iorap-default-dependencies",
Igor Murashkine54aebc2019-01-22 17:58:51 -0800166 "libiorap-manager-default-dependencies",
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700167 ],
168 srcs: [
169 "src/iorapd/main.cc",
170 ],
Igor Murashkine54aebc2019-01-22 17:58:51 -0800171 static_libs: [
172 "libiorap-manager",
173 ],
Igor Murashkin32b6a882018-10-05 16:27:35 -0700174 init_rc: [
175 "iorapd.rc",
176 ],
Yan Wang393667b2020-01-09 09:08:35 -0800177 // iorapd fork+execs into iorap.prefetcherd and iorap.cmd.compiler
Igor Murashkina35242b2020-03-11 13:28:51 -0700178 // maintenance used by tests
Igor Murashkin7097bfc2019-09-05 10:37:59 -0700179 required: [
Yan Wang393667b2020-01-09 09:08:35 -0800180 "iorap.cmd.compiler",
Igor Murashkin7097bfc2019-09-05 10:37:59 -0700181 "iorap.prefetcherd",
Igor Murashkina35242b2020-03-11 13:28:51 -0700182 "iorap.cmd.maintenance",
Igor Murashkin7097bfc2019-09-05 10:37:59 -0700183 ],
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700184}
185
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -0800186cc_library_static {
187 name: "libiorap-inode2filename",
188 defaults: [
189 "iorap-default-flags",
190 "iorap-default-dependencies",
191 ],
192
193 srcs: [
194 "src/inode2filename/**/*.cc",
195 ],
196}
197
198cc_binary {
199 name: "iorap.inode2filename",
200 defaults: [
201 "iorap-default-flags",
202 "iorap-default-dependencies",
203 ],
204 srcs: [
205 "src/inode2filename/**/*.cc",
206 ],
207 // Easier debugging. TODO: make a separate debug config.
208 // XX: Using -O0 seems to completely hide some errors.
209 cflags: ["-O2", "-UNDEBUG", "-DIORAP_INODE2FILENAME_MAIN=1"],
210 sanitize: {
211 undefined: true,
212 all_undefined: true,
213 // Pretty print when ubsan detects a problem.
214 // Otherwise it just calls abort().
215
216/*
217 diag: {
218 undefined: true,
219 },
220 */ // don't use the diag when you want it to crash.
221 },
222}
223
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700224cc_test {
225 name: "iorapd-tests",
Igor Murashkina4d89f52018-10-09 15:00:20 -0700226 test_suites: ["device-tests"],
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -0800227 gtest: false, // we use gtest *and* gmock.
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700228 defaults: [
229 "iorap-default-flags",
230 "iorap-default-dependencies",
Yan Wanga1123fb2019-10-15 15:24:54 -0700231 "libiorap-compiler-default-dependencies",
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700232 ],
233 srcs: [
Yan Wanga1123fb2019-10-15 15:24:54 -0700234 "tests/src/binder/*.cc",
235 "tests/src/inode2filename/*.cc",
236 "tests/src/log/*.cc",
237 "tests/src/tmp/*.cc",
238 ],
239 data: [
240 "tests/src/compiler/testdata/*",
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700241 ],
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -0800242 cflags: ["-O2", "-UNDEBUG"],
Igor Murashkine54aebc2019-01-22 17:58:51 -0800243
244 // TODO: we should probably have per-component tests.
Mathieu Chartier2ccb53d2019-01-18 12:47:49 -0800245 static_libs: ["libgmock_main", "libgmock", "libgtest", "libiorap-inode2filename"],
Yan Wanga1123fb2019-10-15 15:24:54 -0700246
247}
248
249
250cc_test_host {
251 name: "iorapd-host-tests",
Yan Wanga1123fb2019-10-15 15:24:54 -0700252 gtest: false, // we use gtest *and* gmock.
253 defaults: [
254 "iorap-default-flags",
255 "iorap-default-dependencies",
256 "libiorap-compiler-default-dependencies",
Yan Wang65e905d2019-11-16 14:49:56 -0800257 "libiorap-maintenance-default-dependencies",
Yan Wanga1123fb2019-10-15 15:24:54 -0700258 ],
259 srcs: [
260 "tests/src/compiler/*.cc",
Yan Wangd40dac32019-11-21 16:46:40 -0800261 "tests/src/db/*.cc",
Yan Wang65e905d2019-11-16 14:49:56 -0800262 "tests/src/maintenance/*.cc",
Yan Wanga1123fb2019-10-15 15:24:54 -0700263 ],
264 data: [
265 "tests/src/compiler/testdata/*",
Yan Wang65e905d2019-11-16 14:49:56 -0800266 "tests/src/maintenance/testdata/*",
Yan Wanga1123fb2019-10-15 15:24:54 -0700267 ],
268 cflags: ["-O2", "-UNDEBUG"],
269
270 // TODO: we should probably have per-component tests.
Yan Wang65e905d2019-11-16 14:49:56 -0800271 static_libs: [
272 "libgmock_main",
273 "libgmock",
274 "libgtest",
275 "libiorap-compiler",
276 "libiorap-maintenance",
277 ],
Igor Murashkin6d0699b2018-09-28 16:44:48 -0700278}
Igor Murashkinb250cd82019-01-09 11:33:52 -0800279
280filegroup {
281 name: "libiorap-perfetto-protos",
282 srcs: [
283 ],
284}
285
286// Static libraries cannot export their dependencies,
287// the current convention is to use an extra 'defaults' rule for statics
288// to bring in all the dependencies.
289cc_defaults {
290 name: "libiorap-perfetto-default-dependencies",
291
292 // Some of the libperfetto header typedefs leak out into iorap.
293 // Avoids compilation #include errors.
294 // TODO: clean this up, the headers should not leak out (maybe all we need is a PerfettoConsumer
295 // forward declaration?).
296 include_dirs: ["external/perfetto/include"],
297 // Various perfetto protos are used directly by iorap.
298 //
299 // Furthermore, we need this regardless to avoid linking errors when linking
300 // libiorap-perfetto.a into the main cc_binary rule.
301 static_libs: [
302 "perfetto_trace_protos",
303 ],
304
305 shared_libs: [
306 // Not part of true dependencies: Users of 'libiorap-perfetto' do not link against
307 // libperfetto.
308 // We only put this to avoid linking errors when building iorapd.
309 // TODO: can we split iorapd into libiorapd-main that doesn't link against libperfetto?
310 // only the last cc_binary should need the full transitive closure of the dependency graph.
311 "libperfetto",
312 ]
313}
314
315cc_library_static {
316 name: "libiorap-perfetto",
317 defaults: [
318 "iorap-default-flags",
319 "iorap-default-dependencies",
320 "libiorap-perfetto-default-dependencies",
321 ],
322
323 srcs: [
324 "src/perfetto/**/*.cc",
325 ],
326}
327
328cc_binary {
329 name: "iorap.cmd.perfetto",
330 defaults: [
331 "iorap-default-flags",
332 "iorap-default-dependencies",
333 ],
334 shared_libs: ["libperfetto"],
335 include_dirs: ["external/perfetto/include"],
336 srcs: [
337 "src/perfetto/**/*.cc",
338 ],
339 // Easier debugging. TODO: make a separate debug config.
340 // XX: Using -O0 seems to completely hide some errors.
341 cflags: ["-O2", "-UNDEBUG", "-DIORAP_PERFETTO_MAIN=1"],
342 sanitize: {
343 undefined: true,
344 all_undefined: true,
345 // Pretty print when ubsan detects a problem.
346 // Otherwise it just calls abort().
347
348/*
349 diag: {
350 undefined: true,
351 },
352 */ // don't use the diag when you want it to crash.
353 },
354
355 static_libs: [
356 "perfetto_trace_protos",
357 ],
358}
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800359
360// Static libraries cannot export their dependencies,
361// the current convention is to use an extra 'defaults' rule for statics
362// to bring in all the dependencies.
363cc_defaults {
364 name: "libiorap-compiler-default-dependencies",
365
366 defaults: [
367 // use the perfetto namespace
Igor Murashkinb6bce832019-04-10 15:46:06 -0700368 "libiorap-perfetto-default-dependencies",
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800369 // use the inode2filename namespace
Igor Murashkinb6bce832019-04-10 15:46:06 -0700370 "libiorap-serialize-default-dependencies", // uses but does not re-export serialize.
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800371 ],
372
373 // Some of the libperfetto header typedefs leak out into iorap.
374 // Avoids compilation #include errors.
375 // TODO: clean this up, the headers should not leak out (maybe all we need is a PerfettoConsumer
376 // forward declaration?).
377 include_dirs: [],
378 // Various perfetto protos are used directly by iorap.
379 //
380 // Furthermore, we need this regardless to avoid linking errors when linking
381 // libiorap-compiler.a into the main cc_binary rule.
382 static_libs: [
383 "libiorap-perfetto",
384 // "perfetto_trace_protos",
385 "libiorap-inode2filename",
Igor Murashkinb6bce832019-04-10 15:46:06 -0700386 "libiorap-serialize",
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800387 ],
388
389 shared_libs: [
390 // Not part of true dependencies: Users of 'libiorap-compiler' do not link against
391 // libperfetto.
392 // We only put this to avoid linking errors when building iorapd.
393 // TODO: can we split iorapd into libiorapd-main that doesn't link against libperfetto?
394 // only the last cc_binary should need the full transitive closure of the dependency graph.
395 ]
396}
397
398cc_library_static {
399 name: "libiorap-compiler",
400 defaults: [
401 "iorap-default-flags",
402 "iorap-default-dependencies",
403 "libiorap-compiler-default-dependencies",
404 ],
405
406 srcs: [
407 "src/compiler/**/*.cc",
408 ],
409}
410
411cc_binary {
412 name: "iorap.cmd.compiler",
413 defaults: [
414 "iorap-default-flags",
415 "iorap-default-dependencies",
416 "libiorap-compiler-default-dependencies",
417 ],
418 shared_libs: [],
419 include_dirs: [],
420 srcs: [
421 "src/compiler/**/*.cc",
422 ],
423 // Easier debugging. TODO: make a separate debug config.
424 // XX: Using -O0 seems to completely hide some errors.
425 cflags: ["-O2", "-UNDEBUG", "-DIORAP_COMPILER_MAIN=1"],
426 sanitize: {
427 undefined: true,
428 all_undefined: true,
429 // Pretty print when ubsan detects a problem.
430 // Otherwise it just calls abort().
431
432/*
433 diag: {
434 undefined: true,
435 },
436 */ // don't use the diag when you want it to crash.
437 },
438
439 static_libs: [
440 ],
Igor Murashkind8fe2042020-02-18 12:54:31 -0800441 required: [
442 "iorap.inode2filename",
443 ],
Igor Murashkinc86d0d02019-02-22 14:20:42 -0800444}
Igor Murashkine75557d2019-04-08 15:42:50 -0700445
446// Static libraries cannot export their dependencies,
447// the current convention is to use an extra 'defaults' rule for statics
448// to bring in all the dependencies.
449cc_defaults {
450 name: "libiorap-serialize-default-dependencies",
451
452 defaults: [
453 ],
454
455 include_dirs: [],
456 static_libs: [
457 ],
458 shared_libs: [
Igor Murashkinb6bce832019-04-10 15:46:06 -0700459 ],
Igor Murashkine75557d2019-04-08 15:42:50 -0700460 // Above intentionally left empty.
Igor Murashkinb6bce832019-04-10 15:46:06 -0700461 srcs: [
462 "src/serialize/**/*.proto",
463 ],
Igor Murashkine75557d2019-04-08 15:42:50 -0700464}
465
466cc_library_static {
467 name: "libiorap-serialize",
468 defaults: [
469 "iorap-default-flags",
470 "iorap-default-dependencies",
471 "libiorap-serialize-default-dependencies",
472 ],
473
474 srcs: [
475 "src/serialize/**/*.cc",
Igor Murashkine75557d2019-04-08 15:42:50 -0700476 ],
477}
Igor Murashkin6d5c27f2019-04-11 15:34:13 -0700478
479
480// Static libraries cannot export their dependencies,
481// the current convention is to use an extra 'defaults' rule for statics
482// to bring in all the dependencies.
483cc_defaults {
484 name: "libiorap-prefetcher-default-dependencies",
485
486 defaults: [
487 ],
488
489 include_dirs: [],
490 static_libs: [
491 "libiorap-serialize",
492 ],
493 shared_libs: [
Igor Murashkin05134882019-11-11 12:40:17 -0800494 "libminijail",
Igor Murashkin6d5c27f2019-04-11 15:34:13 -0700495 ],
Igor Murashkin6f4fac72019-11-21 14:31:12 -0800496
497 // disable mac builds because libminijail doesn't work there
498 target: {
499 darwin: {
500 enabled: false,
501 },
502 },
Igor Murashkin6d5c27f2019-04-11 15:34:13 -0700503}
504
505cc_library_static {
506 name: "libiorap-prefetcher",
507 defaults: [
508 "iorap-default-flags",
509 "iorap-default-dependencies",
510 "libiorap-prefetcher-default-dependencies",
511 "libiorap-serialize-default-dependencies",
512 ],
513
514 srcs: [
515 "src/prefetcher/**/*.cc",
516 ],
517}
Igor Murashkin7097bfc2019-09-05 10:37:59 -0700518
519cc_binary {
520 name: "iorap.prefetcherd",
521 defaults: [
522 "iorap-default-flags",
523 "iorap-default-dependencies",
524 "libiorap-prefetcher-default-dependencies",
525 "libiorap-serialize-default-dependencies",
526 ],
527 shared_libs: [],
528 include_dirs: [],
529 srcs: [
530 "src/prefetcher/**/*.cc",
531 ],
532 // Easier debugging. TODO: make a separate debug config.
533 // XX: Using -O0 seems to completely hide some errors.
534 cflags: ["-O2", "-UNDEBUG", "-DIORAP_PREFETCHER_MAIN=1"],
535 sanitize: {
536 undefined: true,
537 all_undefined: true,
538 // Pretty print when ubsan detects a problem.
539 // Otherwise it just calls abort().
540
541/*
542 diag: {
543 undefined: true,
544 },
545 */ // don't use the diag when you want it to crash.
546 },
547
548 static_libs: [
549 ],
550}
551
Igor Murashkin6c3686a2019-09-12 15:37:02 -0700552cc_binary {
553 name: "iorap.cmd.prefetcher.client",
554 defaults: [
555 "iorap-default-flags",
556 "iorap-default-dependencies",
557 "libiorap-prefetcher-default-dependencies",
558 "libiorap-serialize-default-dependencies",
559 ],
560 shared_libs: [],
561 include_dirs: [],
562 srcs: [
563 "src/prefetcher/**/*.cc",
564 ],
565 // Easier debugging. TODO: make a separate debug config.
566 // XX: Using -O0 seems to completely hide some errors.
567 cflags: ["-O2", "-UNDEBUG", "-DIORAP_PREFETCHER_MAIN_CLIENT=1"],
568 sanitize: {
569 undefined: true,
570 all_undefined: true,
571 // Pretty print when ubsan detects a problem.
572 // Otherwise it just calls abort().
Igor Murashkin7097bfc2019-09-05 10:37:59 -0700573
Igor Murashkin6c3686a2019-09-12 15:37:02 -0700574/*
575 diag: {
576 undefined: true,
577 },
578 */ // don't use the diag when you want it to crash.
579 },
580
581 static_libs: [
582 ],
583}
Igor Murashkin03e5b052019-10-03 16:39:50 -0700584
Igor Murashkin05134882019-11-11 12:40:17 -0800585prebuilt_etc {
586 name: "iorap.prefetcherd.policy",
587 sub_dir: "seccomp_policy",
588 arch: {
589 arm: {
590 src: "seccomp_policy/prefetcherd.arm.policy"
591 },
592 arm64: {
593 src: "seccomp_policy/prefetcherd.arm64.policy"
594 },
595 x86: {
596 src: "seccomp_policy/prefetcherd.x86.policy"
597 },
598 x86_64: {
599 src: "seccomp_policy/prefetcherd.x86_64.policy"
600 },
601 },
602 required: [
603 "crash_dump.policy",
604 ],
605}
606
Igor Murashkin03e5b052019-10-03 16:39:50 -0700607// Static libraries cannot export their dependencies,
608// the current convention is to use an extra 'defaults' rule for statics
609// to bring in all the dependencies.
610cc_defaults {
611 name: "libiorap-db-default-dependencies",
612
613 defaults: [
614 ],
615
616 include_dirs: [],
617 static_libs: [
618 ],
619 shared_libs: [
620 "libsqlite",
621 ],
622}
623
624cc_library_static {
625 name: "libiorap-db",
626 defaults: [
627 "iorap-default-flags",
628 "iorap-default-dependencies",
629 "libiorap-db-default-dependencies",
630 ],
631
632 srcs: [
633 "src/db/**/*.cc",
634 ],
635}
636
637cc_binary {
638 name: "iorap.cmd.db",
639 defaults: [
640 "iorap-default-flags",
641 "iorap-default-dependencies",
642 "libiorap-db-default-dependencies",
643 ],
644 shared_libs: [],
645 include_dirs: [],
646 srcs: [
647 "src/db/**/*.cc",
648 ],
649 // Easier debugging. TODO: make a separate debug config.
650 // XX: Using -O0 seems to completely hide some errors.
651 cflags: ["-O2", "-UNDEBUG", "-DIORAP_DB_MAIN=1"],
652 sanitize: {
653 undefined: true,
654 all_undefined: true,
655 // Pretty print when ubsan detects a problem.
656 // Otherwise it just calls abort().
657
658/*
659 diag: {
660 undefined: true,
661 },
662 */ // don't use the diag when you want it to crash.
663 },
664
665 static_libs: [
666 ],
667}
Yan Wangcdb97fa2019-10-18 18:18:48 -0700668
669cc_defaults {
670 name: "libiorap-maintenance-default-dependencies",
671
672 defaults: [
673 "libiorap-compiler-default-dependencies",
674 "libiorap-db-default-dependencies",
Igor Murashkin0a7cb8c2020-03-03 15:57:05 -0800675 "libiorap-prefetcher-default-dependencies",
Yan Wangcdb97fa2019-10-18 18:18:48 -0700676 ],
677
678 include_dirs: [],
679
680 static_libs: [
Yan Wang16b8fce2020-02-20 18:08:33 +0000681 "libiorap-binder",
Yan Wangcdb97fa2019-10-18 18:18:48 -0700682 "libiorap-compiler",
683 "libiorap-db",
Igor Murashkin0a7cb8c2020-03-03 15:57:05 -0800684 "libiorap-prefetcher",
Yan Wangcdb97fa2019-10-18 18:18:48 -0700685 ],
686
687 shared_libs: []
688}
689
690cc_library_static {
691 name: "libiorap-maintenance",
692 defaults: [
693 "iorap-default-flags",
694 "iorap-default-dependencies",
695 "libiorap-maintenance-default-dependencies",
696 ],
697
698 srcs: [
699 "src/maintenance/*.cc",
700 ],
701}
702
703cc_binary {
704 name: "iorap.cmd.maintenance",
705 defaults: [
706 "iorap-default-flags",
707 "iorap-default-dependencies",
708 "libiorap-maintenance-default-dependencies",
709 ],
710 shared_libs: [],
711 include_dirs: [],
712 srcs: [
713 "src/maintenance/*.cc",
714 ],
715 cflags: ["-O2", "-UNDEBUG", "-DIORAP_MAINTENANCE_MAIN=1"],
716 sanitize: {
717 undefined: true,
718 all_undefined: true,
719
720 diag: {
721 undefined: true,
722 },
723 },
724
725 static_libs: [],
726}