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 | 16b8fce | 2020-02-20 18:08:33 +0000 | [diff] [blame] | 111 | "src/binder/package_manager_remote.cc", |
| 112 | "src/binder/package_version_map.cc", |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 113 | ], |
| 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 Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 124 | |
Igor Murashkin | e54aebc | 2019-01-22 17:58:51 -0800 | [diff] [blame] | 125 | static_libs: [ |
| 126 | "libplatformprotos", // android framework C++ protos. |
| 127 | ], |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 128 | } |
| 129 | |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 130 | cc_defaults { |
| 131 | name: "libiorap-manager-default-dependencies", |
| 132 | static_libs: [ |
Yan Wang | 16b8fce | 2020-02-20 18:08:33 +0000 | [diff] [blame] | 133 | "libiorap-binder", |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 134 | "libiorap-perfetto", |
Igor Murashkin | f2e0106 | 2019-04-12 15:57:55 -0700 | [diff] [blame] | 135 | "libiorap-prefetcher", |
Igor Murashkin | 03e5b05 | 2019-10-03 16:39:50 -0700 | [diff] [blame] | 136 | "libiorap-db", |
Yan Wang | e16e963 | 2019-11-27 16:33:55 -0800 | [diff] [blame] | 137 | "libiorap-maintenance", |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 138 | ], |
| 139 | defaults: [ |
| 140 | "libiorap-perfetto-default-dependencies", |
Igor Murashkin | f2e0106 | 2019-04-12 15:57:55 -0700 | [diff] [blame] | 141 | "libiorap-prefetcher-default-dependencies", |
Igor Murashkin | 03e5b05 | 2019-10-03 16:39:50 -0700 | [diff] [blame] | 142 | "libiorap-db-default-dependencies", |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 143 | ], |
| 144 | // Users of 'libiorap-manager' also need to include these defaults to avoid |
| 145 | // linking errors. |
| 146 | } |
| 147 | |
| 148 | cc_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 Cross | 5221ec3 | 2019-05-22 11:13:25 -0700 | [diff] [blame] | 157 | "src/manager/**/*.cc", |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 158 | ], |
| 159 | } |
| 160 | |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 161 | cc_binary { |
| 162 | name: "iorapd", |
| 163 | defaults: [ |
| 164 | "iorap-default-flags", |
| 165 | "iorap-default-dependencies", |
Igor Murashkin | e54aebc | 2019-01-22 17:58:51 -0800 | [diff] [blame] | 166 | "libiorap-manager-default-dependencies", |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 167 | ], |
| 168 | srcs: [ |
| 169 | "src/iorapd/main.cc", |
| 170 | ], |
Igor Murashkin | e54aebc | 2019-01-22 17:58:51 -0800 | [diff] [blame] | 171 | static_libs: [ |
| 172 | "libiorap-manager", |
| 173 | ], |
Igor Murashkin | 32b6a88 | 2018-10-05 16:27:35 -0700 | [diff] [blame] | 174 | init_rc: [ |
| 175 | "iorapd.rc", |
| 176 | ], |
Yan Wang | 393667b | 2020-01-09 09:08:35 -0800 | [diff] [blame] | 177 | // iorapd fork+execs into iorap.prefetcherd and iorap.cmd.compiler |
Igor Murashkin | a35242b | 2020-03-11 13:28:51 -0700 | [diff] [blame] | 178 | // maintenance used by tests |
Igor Murashkin | 7097bfc | 2019-09-05 10:37:59 -0700 | [diff] [blame] | 179 | required: [ |
Yan Wang | 393667b | 2020-01-09 09:08:35 -0800 | [diff] [blame] | 180 | "iorap.cmd.compiler", |
Igor Murashkin | 7097bfc | 2019-09-05 10:37:59 -0700 | [diff] [blame] | 181 | "iorap.prefetcherd", |
Igor Murashkin | a35242b | 2020-03-11 13:28:51 -0700 | [diff] [blame] | 182 | "iorap.cmd.maintenance", |
Igor Murashkin | 7097bfc | 2019-09-05 10:37:59 -0700 | [diff] [blame] | 183 | ], |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 184 | } |
| 185 | |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 186 | cc_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 | |
| 198 | cc_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 Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 224 | cc_test { |
| 225 | name: "iorapd-tests", |
Igor Murashkin | a4d89f5 | 2018-10-09 15:00:20 -0700 | [diff] [blame] | 226 | test_suites: ["device-tests"], |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 227 | gtest: false, // we use gtest *and* gmock. |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 228 | defaults: [ |
| 229 | "iorap-default-flags", |
| 230 | "iorap-default-dependencies", |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 231 | "libiorap-compiler-default-dependencies", |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 232 | ], |
| 233 | srcs: [ |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 234 | "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 Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 241 | ], |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 242 | cflags: ["-O2", "-UNDEBUG"], |
Igor Murashkin | e54aebc | 2019-01-22 17:58:51 -0800 | [diff] [blame] | 243 | |
| 244 | // TODO: we should probably have per-component tests. |
Mathieu Chartier | 2ccb53d | 2019-01-18 12:47:49 -0800 | [diff] [blame] | 245 | static_libs: ["libgmock_main", "libgmock", "libgtest", "libiorap-inode2filename"], |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 246 | |
| 247 | } |
| 248 | |
| 249 | |
| 250 | cc_test_host { |
| 251 | name: "iorapd-host-tests", |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 252 | gtest: false, // we use gtest *and* gmock. |
| 253 | defaults: [ |
| 254 | "iorap-default-flags", |
| 255 | "iorap-default-dependencies", |
| 256 | "libiorap-compiler-default-dependencies", |
Yan Wang | 65e905d | 2019-11-16 14:49:56 -0800 | [diff] [blame] | 257 | "libiorap-maintenance-default-dependencies", |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 258 | ], |
| 259 | srcs: [ |
| 260 | "tests/src/compiler/*.cc", |
Yan Wang | d40dac3 | 2019-11-21 16:46:40 -0800 | [diff] [blame] | 261 | "tests/src/db/*.cc", |
Yan Wang | 65e905d | 2019-11-16 14:49:56 -0800 | [diff] [blame] | 262 | "tests/src/maintenance/*.cc", |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 263 | ], |
| 264 | data: [ |
| 265 | "tests/src/compiler/testdata/*", |
Yan Wang | 65e905d | 2019-11-16 14:49:56 -0800 | [diff] [blame] | 266 | "tests/src/maintenance/testdata/*", |
Yan Wang | a1123fb | 2019-10-15 15:24:54 -0700 | [diff] [blame] | 267 | ], |
| 268 | cflags: ["-O2", "-UNDEBUG"], |
| 269 | |
| 270 | // TODO: we should probably have per-component tests. |
Yan Wang | 65e905d | 2019-11-16 14:49:56 -0800 | [diff] [blame] | 271 | static_libs: [ |
| 272 | "libgmock_main", |
| 273 | "libgmock", |
| 274 | "libgtest", |
| 275 | "libiorap-compiler", |
| 276 | "libiorap-maintenance", |
| 277 | ], |
Igor Murashkin | 6d0699b | 2018-09-28 16:44:48 -0700 | [diff] [blame] | 278 | } |
Igor Murashkin | b250cd8 | 2019-01-09 11:33:52 -0800 | [diff] [blame] | 279 | |
| 280 | filegroup { |
| 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. |
| 289 | cc_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 | |
| 315 | cc_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 | |
| 328 | cc_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 Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 359 | |
| 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. |
| 363 | cc_defaults { |
| 364 | name: "libiorap-compiler-default-dependencies", |
| 365 | |
| 366 | defaults: [ |
| 367 | // use the perfetto namespace |
Igor Murashkin | b6bce83 | 2019-04-10 15:46:06 -0700 | [diff] [blame] | 368 | "libiorap-perfetto-default-dependencies", |
Igor Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 369 | // use the inode2filename namespace |
Igor Murashkin | b6bce83 | 2019-04-10 15:46:06 -0700 | [diff] [blame] | 370 | "libiorap-serialize-default-dependencies", // uses but does not re-export serialize. |
Igor Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 371 | ], |
| 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 Murashkin | b6bce83 | 2019-04-10 15:46:06 -0700 | [diff] [blame] | 386 | "libiorap-serialize", |
Igor Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 387 | ], |
| 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 | |
| 398 | cc_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 | |
| 411 | cc_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 Murashkin | d8fe204 | 2020-02-18 12:54:31 -0800 | [diff] [blame] | 441 | required: [ |
| 442 | "iorap.inode2filename", |
| 443 | ], |
Igor Murashkin | c86d0d0 | 2019-02-22 14:20:42 -0800 | [diff] [blame] | 444 | } |
Igor Murashkin | e75557d | 2019-04-08 15:42:50 -0700 | [diff] [blame] | 445 | |
| 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. |
| 449 | cc_defaults { |
| 450 | name: "libiorap-serialize-default-dependencies", |
| 451 | |
| 452 | defaults: [ |
| 453 | ], |
| 454 | |
| 455 | include_dirs: [], |
| 456 | static_libs: [ |
| 457 | ], |
| 458 | shared_libs: [ |
Igor Murashkin | b6bce83 | 2019-04-10 15:46:06 -0700 | [diff] [blame] | 459 | ], |
Igor Murashkin | e75557d | 2019-04-08 15:42:50 -0700 | [diff] [blame] | 460 | // Above intentionally left empty. |
Igor Murashkin | b6bce83 | 2019-04-10 15:46:06 -0700 | [diff] [blame] | 461 | srcs: [ |
| 462 | "src/serialize/**/*.proto", |
| 463 | ], |
Igor Murashkin | e75557d | 2019-04-08 15:42:50 -0700 | [diff] [blame] | 464 | } |
| 465 | |
| 466 | cc_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 Murashkin | e75557d | 2019-04-08 15:42:50 -0700 | [diff] [blame] | 476 | ], |
| 477 | } |
Igor Murashkin | 6d5c27f | 2019-04-11 15:34:13 -0700 | [diff] [blame] | 478 | |
| 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. |
| 483 | cc_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 Murashkin | 0513488 | 2019-11-11 12:40:17 -0800 | [diff] [blame] | 494 | "libminijail", |
Igor Murashkin | 6d5c27f | 2019-04-11 15:34:13 -0700 | [diff] [blame] | 495 | ], |
Igor Murashkin | 6f4fac7 | 2019-11-21 14:31:12 -0800 | [diff] [blame] | 496 | |
| 497 | // disable mac builds because libminijail doesn't work there |
| 498 | target: { |
| 499 | darwin: { |
| 500 | enabled: false, |
| 501 | }, |
| 502 | }, |
Igor Murashkin | 6d5c27f | 2019-04-11 15:34:13 -0700 | [diff] [blame] | 503 | } |
| 504 | |
| 505 | cc_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 Murashkin | 7097bfc | 2019-09-05 10:37:59 -0700 | [diff] [blame] | 518 | |
| 519 | cc_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 Murashkin | 6c3686a | 2019-09-12 15:37:02 -0700 | [diff] [blame] | 552 | cc_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 Murashkin | 7097bfc | 2019-09-05 10:37:59 -0700 | [diff] [blame] | 573 | |
Igor Murashkin | 6c3686a | 2019-09-12 15:37:02 -0700 | [diff] [blame] | 574 | /* |
| 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 Murashkin | 03e5b05 | 2019-10-03 16:39:50 -0700 | [diff] [blame] | 584 | |
Igor Murashkin | 0513488 | 2019-11-11 12:40:17 -0800 | [diff] [blame] | 585 | prebuilt_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 Murashkin | 03e5b05 | 2019-10-03 16:39:50 -0700 | [diff] [blame] | 607 | // 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. |
| 610 | cc_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 | |
| 624 | cc_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 | |
| 637 | cc_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 Wang | cdb97fa | 2019-10-18 18:18:48 -0700 | [diff] [blame] | 668 | |
| 669 | cc_defaults { |
| 670 | name: "libiorap-maintenance-default-dependencies", |
| 671 | |
| 672 | defaults: [ |
| 673 | "libiorap-compiler-default-dependencies", |
| 674 | "libiorap-db-default-dependencies", |
Igor Murashkin | 0a7cb8c | 2020-03-03 15:57:05 -0800 | [diff] [blame] | 675 | "libiorap-prefetcher-default-dependencies", |
Yan Wang | cdb97fa | 2019-10-18 18:18:48 -0700 | [diff] [blame] | 676 | ], |
| 677 | |
| 678 | include_dirs: [], |
| 679 | |
| 680 | static_libs: [ |
Yan Wang | 16b8fce | 2020-02-20 18:08:33 +0000 | [diff] [blame] | 681 | "libiorap-binder", |
Yan Wang | cdb97fa | 2019-10-18 18:18:48 -0700 | [diff] [blame] | 682 | "libiorap-compiler", |
| 683 | "libiorap-db", |
Igor Murashkin | 0a7cb8c | 2020-03-03 15:57:05 -0800 | [diff] [blame] | 684 | "libiorap-prefetcher", |
Yan Wang | cdb97fa | 2019-10-18 18:18:48 -0700 | [diff] [blame] | 685 | ], |
| 686 | |
| 687 | shared_libs: [] |
| 688 | } |
| 689 | |
| 690 | cc_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 | |
| 703 | cc_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 | } |