blob: 8cc34792052f7299310c1f9e8ae61dc8701d9f96 [file] [log] [blame]
Colin Crossc7376e02016-09-08 12:52:18 -07001//
2// Copyright (C) 2016 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Bob Badour9150de62021-02-26 03:22:24 -080017package {
18 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "art_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["art_license"],
24}
25
Colin Crossc7376e02016-09-08 12:52:18 -070026cc_defaults {
27 name: "profman-defaults",
28 host_supported: true,
29 defaults: ["art_defaults"],
30 srcs: [
Mathieu Chartier2f794552017-06-19 10:58:08 -070031 "boot_image_profile.cc",
Colin Crossc7376e02016-09-08 12:52:18 -070032 "profman.cc",
33 "profile_assistant.cc",
34 ],
35
36 target: {
37 android: {
Roland Levillain38a938e2018-09-21 10:55:51 +010038 // Use the 32-bit version of profman on devices.
Colin Crossc7376e02016-09-08 12:52:18 -070039 compile_multilib: "prefer32",
Martin Stjernholm39419da2021-03-28 22:32:16 +010040 shared_libs: [
41 "libbase",
42 ],
43 },
44 host: {
45 whole_static_libs: [
46 "libbase",
47 ],
Colin Crossc7376e02016-09-08 12:52:18 -070048 },
David Srbeckyd53f6062019-03-22 14:55:21 +000049 darwin: {
50 enabled: true,
51 },
Colin Crossc7376e02016-09-08 12:52:18 -070052 },
Martin Stjernholm39419da2021-03-28 22:32:16 +010053}
Colin Crossc7376e02016-09-08 12:52:18 -070054
Martin Stjernholm39419da2021-03-28 22:32:16 +010055// Collect all the static defaults and build a host-only static library, which
56// is then used for the (mostly) static host profman binary.
57art_cc_library_static {
58 name: "libprofman_static",
59 device_supported: false,
60 host_supported: true,
61 defaults: [
62 "art_defaults",
63 "libartbase_static_defaults",
64 "libdexfile_static_defaults",
65 "libprofile_static_defaults",
66 ],
Martin Stjernholma148d612021-03-30 19:02:39 +010067 target: {
68 darwin: {
69 enabled: true,
70 },
71 },
Martin Stjernholm39419da2021-03-28 22:32:16 +010072}
73
74art_cc_library_static {
75 name: "libprofmand_static",
76 device_supported: false,
77 host_supported: true,
78 defaults: [
79 "art_debug_defaults",
Martin Stjernholm36138ac2021-05-12 00:40:23 +010080 "art_defaults",
Martin Stjernholm39419da2021-03-28 22:32:16 +010081 "libartbased_static_defaults",
82 "libdexfiled_static_defaults",
83 "libprofiled_static_defaults",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -070084 ],
Martin Stjernholma148d612021-03-30 19:02:39 +010085 target: {
86 darwin: {
87 enabled: true,
88 },
89 },
Colin Crossc7376e02016-09-08 12:52:18 -070090}
91
92art_cc_binary {
93 name: "profman",
94 defaults: ["profman-defaults"],
Martin Stjernholm39419da2021-03-28 22:32:16 +010095 target: {
96 android: {
97 shared_libs: [
98 "libartbase",
99 "libdexfile",
100 "libprofile",
101 ],
102 },
103 host: {
104 // Make the host binary static, except for system libraries. This
105 // avoids having to bundle host dynamic libs in prebuilts.
106 static_libs: ["libprofman_static"],
107 stl: "c++_static",
108
109 },
110 },
Jiyong Park066dd9022019-12-19 02:11:59 +0000111 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100112 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +0000113 "com.android.art.debug",
114 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700115}
116
117art_cc_binary {
118 name: "profmand",
119 defaults: [
Colin Crossc7376e02016-09-08 12:52:18 -0700120 "art_debug_defaults",
Andreas Gampe5115efb2017-05-24 16:55:54 -0700121 "profman-defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700122 ],
Martin Stjernholm39419da2021-03-28 22:32:16 +0100123 target: {
124 android: {
125 shared_libs: [
126 "libartbased",
127 "libdexfiled",
128 "libprofiled",
129 ],
130 },
131 host: {
132 // Make the host binary static, except for system libraries. This
133 // avoids having to bundle host dynamic libs in prebuilts.
134 static_libs: ["libprofmand_static"],
135 stl: "c++_static",
136
137 },
138 },
Jiyong Park066dd9022019-12-19 02:11:59 +0000139 apex_available: [
140 "com.android.art.debug",
141 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700142}
Colin Cross6e95dd52016-09-12 15:37:10 -0700143
David Sehr9d9227a2018-12-19 12:32:50 -0800144art_cc_binary {
145 name: "profmans",
146 defaults: [
147 "profman-defaults",
148 "libprofile_static_defaults",
149 "libdexfile_static_defaults",
150 "libartbase_static_defaults",
151 ],
152 host_supported: true,
153 device_supported: false,
154 target: {
155 darwin: {
156 enabled: false,
157 },
158 windows: {
159 enabled: true,
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700160 cflags: ["-Wno-thread-safety"],
David Sehr9d9227a2018-12-19 12:32:50 -0800161 },
162 },
163}
164
Roland Levillainf0409142021-03-22 15:45:03 +0000165art_cc_defaults {
166 name: "art_profman_tests_defaults",
David Srbecky4a88a5a2020-05-05 16:21:57 +0100167 data: [
168 ":art-gtest-jars-ProfileTestMultiDex",
169 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700170 srcs: ["profile_assistant_test.cc"],
Roland Levillainf0409142021-03-22 15:45:03 +0000171}
172
173// Version of ART gtest `art_profman_tests` bundled with the ART APEX on target.
174// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
175art_cc_test {
176 name: "art_profman_tests",
177 defaults: [
178 "art_gtest_defaults",
179 "art_profman_tests_defaults",
180 ],
181 shared_libs: [
182 "libprofiled",
183 ],
Yo Chiang169dfb42020-08-07 04:22:18 +0000184 target: {
185 host: {
186 required: ["profmand"],
187 },
188 },
Colin Cross6e95dd52016-09-12 15:37:10 -0700189}
Roland Levillainf0409142021-03-22 15:45:03 +0000190
191// Standalone version of ART gtest `art_profman_tests`, not bundled with the ART APEX on target.
192art_cc_test {
193 name: "art_standalone_profman_tests",
194 defaults: [
195 "art_standalone_gtest_defaults",
196 "art_profman_tests_defaults",
197 ],
198 shared_libs: [
199 "libprofile",
200 ],
201 target: {
202 host: {
203 required: ["profman"],
204 },
205 },
206 test_config_template: "art_standalone_profman_tests.xml",
207}