blob: 6ef8f5848a14040d47200c8752e4379adec39249 [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 Tucci94ca9a92021-01-14 11:16:15 +010017# This GN file should not be referenced in chromium builds.
18assert(!build_with_chromium)
19
Primiano Tucci02c11762019-08-30 00:57:59 +020020# 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 Tucci94ca9a92021-01-14 11:16:15 +010022# perfetto_build_with_android is only true when running the GN -> Android.bp
23# build file translator //tools/gen_android_bp .
24if (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 Fijalkovichef96fb72021-01-06 16:14:33 -080036 "tracing_service_proxy.cc",
Primiano Tucci94ca9a92021-01-14 11:16:15 +010037 ]
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 Fijalkovichef96fb72021-01-06 16:14:33 -080051 "tracingproxy",
Primiano Tucci94ca9a92021-01-14 11:16:15 +010052 "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 Tucci02c11762019-08-30 00:57:59 +020064
Primiano Tucci676f0cc2018-12-03 20:03:26 +010065source_set("headers") {
66 deps = [
67 "../../gn:default_deps",
Lalit Magantid37172d2020-12-10 19:30:05 +000068 "../android_stats:perfetto_atoms",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010069 ]
70 sources = [
Isabelle Taylorf3edbfa2019-03-26 11:07:19 +000071 "atrace_hal.h",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010072 "health_hal.h",
Ryan Savitski53ca60b2019-06-03 13:04:40 +010073 "incident_service.h",
Esteban Talavera1fecac92019-01-09 16:06:29 +000074 "power_stats_hal.h",
Hector Dearman92d7d112019-12-05 15:19:57 +000075 "statsd_logging.h",
Collin Fijalkovichef96fb72021-01-06 16:14:33 -080076 "tracing_service_proxy.h",
Primiano Tucci676f0cc2018-12-03 20:03:26 +010077 ]
78}
79
Primiano Tuccia6ebe132019-07-24 22:59:23 +010080source_set("lazy_library_loader") {
Primiano Tucci2925e9d2020-01-27 10:15:58 +000081 public_deps = [ ":headers" ]
Primiano Tuccia6ebe132019-07-24 22:59:23 +010082 deps = [
83 "../../gn:default_deps",
84 "../../src/base",
85 ]
86 sources = [
87 "lazy_library_loader.cc",
88 "lazy_library_loader.h",
89 ]
Primiano Tucci24fb3e82021-01-05 14:33:28 +010090 if (!is_win) {
91 libs = [ "dl" ]
92 }
Primiano Tuccia6ebe132019-07-24 22:59:23 +010093}