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 | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame^] | 17 | # This target is supported only in in-tree builds of Android. It contains |
| 18 | # code that is not NDK-clean and references other repos in the Android tree. |
| 19 | shared_library("libperfetto_android_internal") { |
| 20 | deps = [ |
| 21 | ":android_internal", |
| 22 | "../../gn:default_deps", |
| 23 | ] |
| 24 | } |
| 25 | |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 26 | source_set("headers") { |
| 27 | deps = [ |
| 28 | "../../gn:default_deps", |
| 29 | ] |
| 30 | sources = [ |
Isabelle Taylor | f3edbfa | 2019-03-26 11:07:19 +0000 | [diff] [blame] | 31 | "atrace_hal.h", |
Primiano Tucci | ec62e3e | 2019-07-26 22:18:31 +0100 | [diff] [blame] | 32 | "dropbox_service.h", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 33 | "health_hal.h", |
Ryan Savitski | 53ca60b | 2019-06-03 13:04:40 +0100 | [diff] [blame] | 34 | "incident_service.h", |
Esteban Talavera | 1fecac9 | 2019-01-09 16:06:29 +0000 | [diff] [blame] | 35 | "power_stats_hal.h", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 36 | ] |
| 37 | } |
| 38 | |
Primiano Tucci | a6ebe13 | 2019-07-24 22:59:23 +0100 | [diff] [blame] | 39 | source_set("lazy_library_loader") { |
| 40 | public_deps = [ |
| 41 | ":headers", |
| 42 | ] |
| 43 | deps = [ |
| 44 | "../../gn:default_deps", |
| 45 | "../../src/base", |
| 46 | ] |
| 47 | sources = [ |
| 48 | "lazy_library_loader.cc", |
| 49 | "lazy_library_loader.h", |
| 50 | ] |
| 51 | libs = [ "dl" ] |
| 52 | } |
| 53 | |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 54 | # This target proxies calls to Android internal libraries that are not part of |
| 55 | # the NDK. See README.md. |
| 56 | source_set("android_internal") { |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame^] | 57 | visibility = [ ":libperfetto_android_internal" ] |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 58 | deps = [ |
| 59 | ":headers", |
| 60 | "../../gn:default_deps", |
| 61 | ] |
| 62 | if (perfetto_build_with_android) { |
| 63 | sources = [ |
Isabelle Taylor | f3edbfa | 2019-03-26 11:07:19 +0000 | [diff] [blame] | 64 | "atrace_hal.cc", |
Primiano Tucci | ec62e3e | 2019-07-26 22:18:31 +0100 | [diff] [blame] | 65 | "dropbox_service.cc", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 66 | "health_hal.cc", |
Ryan Savitski | 53ca60b | 2019-06-03 13:04:40 +0100 | [diff] [blame] | 67 | "incident_service.cc", |
Esteban Talavera | 1fecac9 | 2019-01-09 16:06:29 +0000 | [diff] [blame] | 68 | "power_stats_hal.cc", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 69 | ] |
| 70 | libs = [ |
| 71 | "android.hardware.health@2.0", |
Esteban Talavera | 1fecac9 | 2019-01-09 16:06:29 +0000 | [diff] [blame] | 72 | "android.hardware.power.stats@1.0", |
Isabelle Taylor | f3edbfa | 2019-03-26 11:07:19 +0000 | [diff] [blame] | 73 | "android.hardware.atrace@1.0", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 74 | "base", |
Ryan Savitski | 53ca60b | 2019-06-03 13:04:40 +0100 | [diff] [blame] | 75 | "binder", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 76 | "log", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 77 | "hidlbase", |
Ryan Savitski | 53ca60b | 2019-06-03 13:04:40 +0100 | [diff] [blame] | 78 | "incident", |
Primiano Tucci | ec62e3e | 2019-07-26 22:18:31 +0100 | [diff] [blame] | 79 | "services", |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 80 | "utils", |
| 81 | ] |
| 82 | } |
| 83 | |
| 84 | # This target should never depend on any other perfetto target to avoid ODR |
| 85 | # violation by doubly linking code in two .so(s) loaded in the same exe. |
| 86 | assert_no_deps = [ |
| 87 | "//src/base/*", |
| 88 | "//src/tracing/*", |
| 89 | "//include/*", |
| 90 | ] |
| 91 | } |