Igor Murashkin | 75f9363 | 2018-09-25 17:54:09 -0700 | [diff] [blame] | 1 | // 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 | |
| 15 | filegroup { |
| 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 Willemsen | f775284 | 2019-06-04 16:19:35 -0700 | [diff] [blame] | 26 | path: "binder", |
Igor Murashkin | 75f9363 | 2018-09-25 17:54:09 -0700 | [diff] [blame] | 27 | } |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 28 | |
| 29 | cc_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 Murashkin | e54aebc | 2019-01-22 17:58:51 -0800 | [diff] [blame] | 51 | /* |
| 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 Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 63 | clang: true, |
Yan Wang | d40dac3 | 2019-11-21 16:46:40 -0800 | [diff] [blame] | 64 | static_libs: ["libc++fs"], |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 65 | shared_libs: ["libbase"], |
Igor Murashkin | 2f11340 | 2019-09-24 13:14:02 -0700 | [diff] [blame] | 66 | |
| 67 | // build all ioraps for host. |
| 68 | host_supported: true, |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | cc_defaults { |
| 72 | name: "iorap-default-dependencies", |
| 73 | |
| 74 | static_libs: [ |
| 75 | "libiorap-binder", |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 76 | "libplatformprotos", // android framework C++ protos. |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 77 | ], |
| 78 | shared_libs: [ |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 79 | "libbinder", |
| 80 | "libutils", |
| 81 | "libcutils", // tracing. |
| 82 | |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 83 | "libfruit", // dependency injection. |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 84 | // TODO: remove these annoying dependencies by hiding them in the main library code. |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 85 | |
| 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 Chartier | 0280cda | 2019-12-03 13:28:25 -0800 | [diff] [blame] | 92 | |
| 93 | // phenotype flags support |
| 94 | "server_configurable_flags", |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 95 | ], |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 96 | |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 97 | // srcs: [":libprotobuf-internal-protos"], |
| 98 | // commented out because it causes compilation errors |
| 99 | // TODO: can we use the lite library somehow? |
| 100 | |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 101 | header_libs: ["librxcpp"], |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 102 | } |
| 103 | |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 104 | cc_library_static { |
| 105 | name: "libiorap-binder", |
| 106 | defaults: ["iorap-default-flags"], |
| 107 | |
| 108 | srcs: [ |
| 109 | ":iorap-aidl", |
| 110 | "src/binder/iiorap_impl.cc", |
Yan Wang | 3a8d95e | 2020-03-05 10:40:31 -0800 | [diff] [blame] | 111 | "src/binder/package_change_observer.cc", |
Yan Wang | 16b8fce | 2020-02-20 18:08:33 +0000 | [diff] [blame] | 112 | "src/binder/package_manager_remote.cc", |
| 113 | "src/binder/package_version_map.cc", |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 114 | ], |
| 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 Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 125 | |
Igor Murashkin | e54aebc | 2019-01-22 17:58:51 -0800 | [diff] [blame] | 126 | static_libs: [ |
| 127 | "libplatformprotos", // android framework C++ protos. |
| 128 | ], |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 129 | } |
| 130 | |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 131 | cc_defaults { |
| 132 | name: "libiorap-manager-default-dependencies", |
| 133 | static_libs: [ |
Yan Wang | 16b8fce | 2020-02-20 18:08:33 +0000 | [diff] [blame] | 134 | "libiorap-binder", |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 135 | "libiorap-perfetto", |
Igor Murashkin | f2e0106 | 2019-04-12 15:57:55 -0700 | [diff] [blame] | 136 | "libiorap-prefetcher", |
Igor Murashkin | 03e5b05 | 2019-10-03 16:39:50 -0700 | [diff] [blame] | 137 | "libiorap-db", |
Yan Wang | e16e963 | 2019-11-27 16:33:55 -0800 | [diff] [blame] | 138 | "libiorap-maintenance", |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 139 | ], |
| 140 | defaults: [ |
| 141 | "libiorap-perfetto-default-dependencies", |
Igor Murashkin | f2e0106 | 2019-04-12 15:57:55 -0700 | [diff] [blame] | 142 | "libiorap-prefetcher-default-dependencies", |
Igor Murashkin | 03e5b05 | 2019-10-03 16:39:50 -0700 | [diff] [blame] | 143 | "libiorap-db-default-dependencies", |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 144 | ], |
| 145 | // Users of 'libiorap-manager' also need to include these defaults to avoid |
| 146 | // linking errors. |
| 147 | } |
| 148 | |
| 149 | cc_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 Cross | 5221ec3 | 2019-05-22 11:13:25 -0700 | [diff] [blame] | 158 | "src/manager/**/*.cc", |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 159 | ], |
| 160 | } |
| 161 | |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 162 | cc_binary { |
| 163 | name: "iorapd", |
| 164 | defaults: [ |
| 165 | "iorap-default-flags", |
| 166 | "iorap-default-dependencies", |
Igor Murashkin | e54aebc | 2019-01-22 17:58:51 -0800 | [diff] [blame] | 167 | "libiorap-manager-default-dependencies", |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 168 | ], |
| 169 | srcs: [ |
| 170 | "src/iorapd/main.cc", |
| 171 | ], |
Igor Murashkin | e54aebc | 2019-01-22 17:58:51 -0800 | [diff] [blame] | 172 | static_libs: [ |
| 173 | "libiorap-manager", |
| 174 | ], |
Igor Murashkin | 32b6a88 | 2018-10-05 16:27:35 -0700 | [diff] [blame] | 175 | init_rc: [ |
| 176 | "iorapd.rc", |
| 177 | ], |
Yan Wang | 393667b | 2020-01-09 09:08:35 -0800 | [diff] [blame] | 178 | // iorapd fork+execs into iorap.prefetcherd and iorap.cmd.compiler |
Igor Murashkin | a35242b | 2020-03-11 13:28:51 -0700 | [diff] [blame] | 179 | // maintenance used by tests |
Igor Murashkin | 7097bfc | 2019-09-05 10:37:59 -0700 | [diff] [blame] | 180 | required: [ |
Yan Wang | 393667b | 2020-01-09 09:08:35 -0800 | [diff] [blame] | 181 | "iorap.cmd.compiler", |
Igor Murashkin | 7097bfc | 2019-09-05 10:37:59 -0700 | [diff] [blame] | 182 | "iorap.prefetcherd", |
Igor Murashkin | a35242b | 2020-03-11 13:28:51 -0700 | [diff] [blame] | 183 | "iorap.cmd.maintenance", |
Igor Murashkin | 7097bfc | 2019-09-05 10:37:59 -0700 | [diff] [blame] | 184 | ], |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 185 | } |
| 186 | |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 187 | cc_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 | |
| 199 | cc_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 Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 225 | cc_test { |
| 226 | name: "iorapd-tests", |
Igor Murashkin | a4d89f5 | 2018-10-09 15:00:20 -0700 | [diff] [blame] | 227 | test_suites: ["device-tests"], |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 228 | gtest: false, // we use gtest *and* gmock. |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 229 | defaults: [ |
| 230 | "iorap-default-flags", |
| 231 | "iorap-default-dependencies", |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 232 | "libiorap-compiler-default-dependencies", |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 233 | ], |
| 234 | srcs: [ |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 235 | "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 Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 242 | ], |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 243 | cflags: ["-O2", "-UNDEBUG"], |
Igor Murashkin | e54aebc | 2019-01-22 17:58:51 -0800 | [diff] [blame] | 244 | |
| 245 | // TODO: we should probably have per-component tests. |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 246 | static_libs: ["libgmock_main", "libgmock", "libgtest", "libiorap-inode2filename"], |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 247 | |
| 248 | } |
| 249 | |
| 250 | |
| 251 | cc_test_host { |
| 252 | name: "iorapd-host-tests", |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 253 | gtest: false, // we use gtest *and* gmock. |
| 254 | defaults: [ |
| 255 | "iorap-default-flags", |
| 256 | "iorap-default-dependencies", |
| 257 | "libiorap-compiler-default-dependencies", |
Yan Wang | 65e905d | 2019-11-16 14:49:56 -0800 | [diff] [blame] | 258 | "libiorap-maintenance-default-dependencies", |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 259 | ], |
| 260 | srcs: [ |
| 261 | "tests/src/compiler/*.cc", |
Yan Wang | d40dac3 | 2019-11-21 16:46:40 -0800 | [diff] [blame] | 262 | "tests/src/db/*.cc", |
Yan Wang | 65e905d | 2019-11-16 14:49:56 -0800 | [diff] [blame] | 263 | "tests/src/maintenance/*.cc", |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 264 | ], |
| 265 | data: [ |
| 266 | "tests/src/compiler/testdata/*", |
Yan Wang | 65e905d | 2019-11-16 14:49:56 -0800 | [diff] [blame] | 267 | "tests/src/maintenance/testdata/*", |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 268 | ], |
| 269 | cflags: ["-O2", "-UNDEBUG"], |
| 270 | |
| 271 | // TODO: we should probably have per-component tests. |
Yan Wang | 65e905d | 2019-11-16 14:49:56 -0800 | [diff] [blame] | 272 | static_libs: [ |
| 273 | "libgmock_main", |
| 274 | "libgmock", |
| 275 | "libgtest", |
| 276 | "libiorap-compiler", |
| 277 | "libiorap-maintenance", |
| 278 | ], |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 279 | } |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 280 | |
| 281 | filegroup { |
| 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. |
| 290 | cc_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 | |
| 316 | cc_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 | |
| 329 | cc_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 Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 360 | |
| 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. |
| 364 | cc_defaults { |
| 365 | name: "libiorap-compiler-default-dependencies", |
| 366 | |
| 367 | defaults: [ |
| 368 | // use the perfetto namespace |
Igor Murashkin | b6bce83 | 2019-04-10 15:46:06 -0700 | [diff] [blame] | 369 | "libiorap-perfetto-default-dependencies", |
Igor Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 370 | // use the inode2filename namespace |
Igor Murashkin | b6bce83 | 2019-04-10 15:46:06 -0700 | [diff] [blame] | 371 | "libiorap-serialize-default-dependencies", // uses but does not re-export serialize. |
Igor Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 372 | ], |
| 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 Murashkin | b6bce83 | 2019-04-10 15:46:06 -0700 | [diff] [blame] | 387 | "libiorap-serialize", |
Igor Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 388 | ], |
| 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 | |
| 399 | cc_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 | |
| 412 | cc_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 Murashkin | d8fe204 | 2020-02-18 12:54:31 -0800 | [diff] [blame] | 442 | required: [ |
| 443 | "iorap.inode2filename", |
| 444 | ], |
Igor Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 445 | } |
Igor Murashkin | e75557d | 2019-04-08 15:42:50 -0700 | [diff] [blame] | 446 | |
| 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. |
| 450 | cc_defaults { |
| 451 | name: "libiorap-serialize-default-dependencies", |
| 452 | |
| 453 | defaults: [ |
| 454 | ], |
| 455 | |
| 456 | include_dirs: [], |
| 457 | static_libs: [ |
| 458 | ], |
| 459 | shared_libs: [ |
Igor Murashkin | b6bce83 | 2019-04-10 15:46:06 -0700 | [diff] [blame] | 460 | ], |
Igor Murashkin | e75557d | 2019-04-08 15:42:50 -0700 | [diff] [blame] | 461 | // Above intentionally left empty. |
Igor Murashkin | b6bce83 | 2019-04-10 15:46:06 -0700 | [diff] [blame] | 462 | srcs: [ |
| 463 | "src/serialize/**/*.proto", |
| 464 | ], |
Igor Murashkin | e75557d | 2019-04-08 15:42:50 -0700 | [diff] [blame] | 465 | } |
| 466 | |
| 467 | cc_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 Murashkin | e75557d | 2019-04-08 15:42:50 -0700 | [diff] [blame] | 477 | ], |
| 478 | } |
Igor Murashkin | 6d5c27f | 2019-04-11 15:34:13 -0700 | [diff] [blame] | 479 | |
| 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. |
| 484 | cc_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 Murashkin | 0513488 | 2019-11-11 12:40:17 -0800 | [diff] [blame] | 495 | "libminijail", |
Igor Murashkin | 6d5c27f | 2019-04-11 15:34:13 -0700 | [diff] [blame] | 496 | ], |
Igor Murashkin | 6f4fac7 | 2019-11-21 14:31:12 -0800 | [diff] [blame] | 497 | |
| 498 | // disable mac builds because libminijail doesn't work there |
| 499 | target: { |
| 500 | darwin: { |
| 501 | enabled: false, |
| 502 | }, |
| 503 | }, |
Igor Murashkin | 6d5c27f | 2019-04-11 15:34:13 -0700 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | cc_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 Murashkin | 7097bfc | 2019-09-05 10:37:59 -0700 | [diff] [blame] | 519 | |
| 520 | cc_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 Murashkin | 6c3686a | 2019-09-12 15:37:02 -0700 | [diff] [blame] | 553 | cc_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 Murashkin | 7097bfc | 2019-09-05 10:37:59 -0700 | [diff] [blame] | 574 | |
Igor Murashkin | 6c3686a | 2019-09-12 15:37:02 -0700 | [diff] [blame] | 575 | /* |
| 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 Murashkin | 03e5b05 | 2019-10-03 16:39:50 -0700 | [diff] [blame] | 585 | |
Igor Murashkin | 0513488 | 2019-11-11 12:40:17 -0800 | [diff] [blame] | 586 | prebuilt_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 Murashkin | 03e5b05 | 2019-10-03 16:39:50 -0700 | [diff] [blame] | 608 | // 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. |
| 611 | cc_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 | |
| 625 | cc_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 | |
| 638 | cc_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 Wang | cdb97fa | 2019-10-18 18:18:48 -0700 | [diff] [blame] | 669 | |
| 670 | cc_defaults { |
| 671 | name: "libiorap-maintenance-default-dependencies", |
| 672 | |
| 673 | defaults: [ |
| 674 | "libiorap-compiler-default-dependencies", |
| 675 | "libiorap-db-default-dependencies", |
Igor Murashkin | 0a7cb8c | 2020-03-03 15:57:05 -0800 | [diff] [blame] | 676 | "libiorap-prefetcher-default-dependencies", |
Yan Wang | cdb97fa | 2019-10-18 18:18:48 -0700 | [diff] [blame] | 677 | ], |
| 678 | |
| 679 | include_dirs: [], |
| 680 | |
| 681 | static_libs: [ |
Yan Wang | 16b8fce | 2020-02-20 18:08:33 +0000 | [diff] [blame] | 682 | "libiorap-binder", |
Yan Wang | cdb97fa | 2019-10-18 18:18:48 -0700 | [diff] [blame] | 683 | "libiorap-compiler", |
| 684 | "libiorap-db", |
Igor Murashkin | 0a7cb8c | 2020-03-03 15:57:05 -0800 | [diff] [blame] | 685 | "libiorap-prefetcher", |
Yan Wang | cdb97fa | 2019-10-18 18:18:48 -0700 | [diff] [blame] | 686 | ], |
| 687 | |
| 688 | shared_libs: [] |
| 689 | } |
| 690 | |
| 691 | cc_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 | |
| 704 | cc_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 | } |