Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [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 | import("../../gn/perfetto.gni") |
| 16 | |
Primiano Tucci | 94ca9a9 | 2021-01-14 11:16:15 +0100 | [diff] [blame] | 17 | # This GN file should not be referenced in chromium builds. |
| 18 | assert(!build_with_chromium) |
| 19 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 20 | # This target is supported only in in-tree builds of Android. It contains |
| 21 | # code that is not NDK-clean and references other repos in the Android tree. |
Primiano Tucci | 94ca9a9 | 2021-01-14 11:16:15 +0100 | [diff] [blame] | 22 | # perfetto_build_with_android is only true when running the GN -> Android.bp |
| 23 | # build file translator //tools/gen_android_bp . |
| 24 | if (perfetto_build_with_android) { |
| 25 | shared_library("libperfetto_android_internal") { |
| 26 | deps = [ |
| 27 | ":headers", |
| 28 | "../../gn:default_deps", |
| 29 | ] |
| 30 | sources = [ |
| 31 | "atrace_hal.cc", |
| 32 | "health_hal.cc", |
| 33 | "incident_service.cc", |
| 34 | "power_stats_hal.cc", |
| 35 | "statsd_logging.cc", |
Collin Fijalkovich | ef96fb7 | 2021-01-06 16:14:33 -0800 | [diff] [blame] | 36 | "tracing_service_proxy.cc", |
Primiano Tucci | 94ca9a9 | 2021-01-14 11:16:15 +0100 | [diff] [blame] | 37 | ] |
| 38 | libs = [ |
| 39 | "android.hardware.health@2.0", |
| 40 | "android.hardware.power.stats@1.0", |
| 41 | "android.hardware.atrace@1.0", |
| 42 | "statslog_perfetto", |
| 43 | "statssocket", |
| 44 | "cutils", |
| 45 | "base", |
| 46 | "binder", |
| 47 | "log", |
| 48 | "hidlbase", |
| 49 | "incident", |
| 50 | "services", |
Collin Fijalkovich | ef96fb7 | 2021-01-06 16:14:33 -0800 | [diff] [blame] | 51 | "tracingproxy", |
Primiano Tucci | 94ca9a9 | 2021-01-14 11:16:15 +0100 | [diff] [blame] | 52 | "utils", |
| 53 | ] |
| 54 | |
| 55 | # This target should never depend on any other perfetto target to avoid ODR |
| 56 | # violation by doubly linking code in two .so(s) loaded in the same exe. |
| 57 | assert_no_deps = [ |
| 58 | "//include/*", |
| 59 | "//src/base/*", |
| 60 | "//src/tracing/*", |
| 61 | ] |
| 62 | } |
| 63 | } # if (perfetto_build_with_android) |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 64 | |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 65 | source_set("headers") { |
| 66 | deps = [ |
| 67 | "../../gn:default_deps", |
Lalit Maganti | d37172d | 2020-12-10 19:30:05 +0000 | [diff] [blame] | 68 | "../android_stats:perfetto_atoms", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 69 | ] |
| 70 | sources = [ |
Isabelle Taylor | f3edbfa | 2019-03-26 11:07:19 +0000 | [diff] [blame] | 71 | "atrace_hal.h", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 72 | "health_hal.h", |
Ryan Savitski | 53ca60b | 2019-06-03 13:04:40 +0100 | [diff] [blame] | 73 | "incident_service.h", |
Esteban Talavera | 1fecac9 | 2019-01-09 16:06:29 +0000 | [diff] [blame] | 74 | "power_stats_hal.h", |
Hector Dearman | 92d7d11 | 2019-12-05 15:19:57 +0000 | [diff] [blame] | 75 | "statsd_logging.h", |
Collin Fijalkovich | ef96fb7 | 2021-01-06 16:14:33 -0800 | [diff] [blame] | 76 | "tracing_service_proxy.h", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 77 | ] |
| 78 | } |
| 79 | |
Primiano Tucci | a6ebe13 | 2019-07-24 22:59:23 +0100 | [diff] [blame] | 80 | source_set("lazy_library_loader") { |
Primiano Tucci | 2925e9d | 2020-01-27 10:15:58 +0000 | [diff] [blame] | 81 | public_deps = [ ":headers" ] |
Primiano Tucci | a6ebe13 | 2019-07-24 22:59:23 +0100 | [diff] [blame] | 82 | deps = [ |
| 83 | "../../gn:default_deps", |
| 84 | "../../src/base", |
| 85 | ] |
| 86 | sources = [ |
| 87 | "lazy_library_loader.cc", |
| 88 | "lazy_library_loader.h", |
| 89 | ] |
Primiano Tucci | 24fb3e8 | 2021-01-05 14:33:28 +0100 | [diff] [blame] | 90 | if (!is_win) { |
| 91 | libs = [ "dl" ] |
| 92 | } |
Primiano Tucci | a6ebe13 | 2019-07-24 22:59:23 +0100 | [diff] [blame] | 93 | } |