• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
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
17package {
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
26cc_defaults {
27    name: "profman-defaults",
28    host_supported: true,
29    defaults: ["art_defaults"],
30    srcs: [
31        "boot_image_profile.cc",
32        "profman.cc",
33        "profile_assistant.cc",
34    ],
35    header_libs: ["profman_headers"],
36
37    target: {
38        android: {
39            compile_multilib: "first",
40            shared_libs: [
41                "libbase",
42            ],
43        },
44        host: {
45            whole_static_libs: [
46                "libbase",
47            ],
48        },
49        darwin: {
50            enabled: true,
51        },
52    },
53}
54
55// 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    ],
67    target: {
68        darwin: {
69            enabled: true,
70        },
71    },
72}
73
74art_cc_library_static {
75    name: "libprofmand_static",
76    device_supported: false,
77    host_supported: true,
78    defaults: [
79        "art_debug_defaults",
80        "libartbased_static_defaults",
81        "libdexfiled_static_defaults",
82        "libprofiled_static_defaults",
83    ],
84    target: {
85        darwin: {
86            enabled: true,
87        },
88    },
89}
90
91art_cc_binary {
92    name: "profman",
93    defaults: ["profman-defaults"],
94    target: {
95        android: {
96            shared_libs: [
97                "libartbase",
98                "libdexfile",
99                "libprofile",
100            ],
101        },
102        host: {
103            // Make the host binary static, except for system libraries. This
104            // avoids having to bundle host dynamic libs in prebuilts.
105            static_libs: ["libprofman_static"],
106            stl: "c++_static",
107
108        },
109    },
110    apex_available: [
111        "com.android.art",
112        "com.android.art.debug",
113        "test_broken_com.android.art",
114    ],
115}
116
117art_cc_binary {
118    name: "profmand",
119    defaults: [
120        "art_debug_defaults",
121        "profman-defaults",
122    ],
123    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    },
139    apex_available: [
140        "com.android.art.debug",
141    ],
142}
143
144art_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,
160            cflags: ["-Wno-thread-safety"],
161        },
162    },
163}
164
165cc_library_headers {
166    name: "profman_headers",
167    defaults: ["art_defaults"],
168    export_include_dirs: ["include"],
169    host_supported: true,
170    target: {
171        darwin: {
172            enabled: false,
173        },
174        windows: {
175            enabled: true,
176        },
177    },
178    apex_available: [
179        "com.android.art",
180        "com.android.art.debug",
181    ],
182}
183
184art_cc_defaults {
185    name: "art_profman_tests_defaults",
186    data: [
187        ":art-gtest-jars-ProfileTestMultiDex",
188    ],
189    header_libs: ["profman_headers"],
190    tidy_timeout_srcs: ["profile_assistant_test.cc"],
191    srcs: ["profile_assistant_test.cc"],
192}
193
194// Version of ART gtest `art_profman_tests` bundled with the ART APEX on target.
195// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
196art_cc_test {
197    name: "art_profman_tests",
198    defaults: [
199        "art_gtest_defaults",
200        "art_profman_tests_defaults",
201    ],
202    shared_libs: [
203        "libprofiled",
204    ],
205    target: {
206        host: {
207            required: ["profmand"],
208        },
209    },
210}
211
212// Standalone version of ART gtest `art_profman_tests`, not bundled with the ART APEX on target.
213art_cc_test {
214    name: "art_standalone_profman_tests",
215    defaults: [
216        "art_standalone_gtest_defaults",
217        "art_profman_tests_defaults",
218    ],
219    data: [":generate-boot-image"],
220    shared_libs: [
221        "libprofile",
222    ],
223    target: {
224        host: {
225            required: ["profman"],
226        },
227    },
228    test_config_template: "art_standalone_profman_tests.xml",
229}
230