blob: 819532abbc2176890a730571904fc5b677b0ca62 [file] [log] [blame]
Primiano Tucci676f0cc2018-12-03 20:03:26 +01001# 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
15import("../../gn/perfetto.gni")
16
Primiano Tucci02c11762019-08-30 00:57:59 +020017# 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.
19shared_library("libperfetto_android_internal") {
20 deps = [
21 ":android_internal",
22 "../../gn:default_deps",
23 ]
24}
25
Primiano Tucci676f0cc2018-12-03 20:03:26 +010026source_set("headers") {
27 deps = [
28 "../../gn:default_deps",
29 ]
30 sources = [
Isabelle Taylorf3edbfa2019-03-26 11:07:19 +000031 "atrace_hal.h",
Primiano Tucciec62e3e2019-07-26 22:18:31 +010032 "dropbox_service.h",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010033 "health_hal.h",
Ryan Savitski53ca60b2019-06-03 13:04:40 +010034 "incident_service.h",
Esteban Talavera1fecac92019-01-09 16:06:29 +000035 "power_stats_hal.h",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010036 ]
37}
38
Primiano Tuccia6ebe132019-07-24 22:59:23 +010039source_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 Tucci676f0cc2018-12-03 20:03:26 +010054# This target proxies calls to Android internal libraries that are not part of
55# the NDK. See README.md.
56source_set("android_internal") {
Primiano Tucci02c11762019-08-30 00:57:59 +020057 visibility = [ ":libperfetto_android_internal" ]
Primiano Tucci676f0cc2018-12-03 20:03:26 +010058 deps = [
59 ":headers",
60 "../../gn:default_deps",
61 ]
62 if (perfetto_build_with_android) {
63 sources = [
Isabelle Taylorf3edbfa2019-03-26 11:07:19 +000064 "atrace_hal.cc",
Primiano Tucciec62e3e2019-07-26 22:18:31 +010065 "dropbox_service.cc",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010066 "health_hal.cc",
Ryan Savitski53ca60b2019-06-03 13:04:40 +010067 "incident_service.cc",
Esteban Talavera1fecac92019-01-09 16:06:29 +000068 "power_stats_hal.cc",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010069 ]
70 libs = [
71 "android.hardware.health@2.0",
Esteban Talavera1fecac92019-01-09 16:06:29 +000072 "android.hardware.power.stats@1.0",
Isabelle Taylorf3edbfa2019-03-26 11:07:19 +000073 "android.hardware.atrace@1.0",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010074 "base",
Ryan Savitski53ca60b2019-06-03 13:04:40 +010075 "binder",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010076 "log",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010077 "hidlbase",
Ryan Savitski53ca60b2019-06-03 13:04:40 +010078 "incident",
Primiano Tucciec62e3e2019-07-26 22:18:31 +010079 "services",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010080 "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}