xref: /aosp_15_r20/art/libprofile/Android.bp (revision 795d594fd825385562da6b089ea9b2033f3abf5a)
1//
2// Copyright (C) 2018 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    default_team: "trendy_team_art_performance",
25}
26
27cc_defaults {
28    name: "libprofile_defaults",
29    defaults: ["art_defaults"],
30    host_supported: true,
31    srcs: [
32        "profile/profile_boot_info.cc",
33        "profile/profile_compilation_info.cc",
34    ],
35    target: {
36        android: {
37            shared_libs: [
38                "libartpalette",
39                "libbase",
40                "libz",
41            ],
42            static_libs: [
43                "libmodules-utils-build",
44                // ZipArchive support, the order matters here to get all symbols.
45                "libziparchive",
46            ],
47            export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
48            export_static_lib_headers: ["libmodules-utils-build"],
49        },
50        not_windows: {
51            shared_libs: [
52                "libartpalette",
53                "libziparchive",
54                "libz",
55                "libbase",
56            ],
57            export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
58        },
59        windows: {
60            cflags: ["-Wno-thread-safety"],
61            static_libs: [
62                "libartpalette",
63                "libziparchive",
64                "libz",
65                "libbase",
66            ],
67            export_static_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h.
68        },
69        darwin: {
70            enabled: true,
71        },
72    },
73    //generated_sources: ["art_libartbase_operator_srcs"],
74    export_include_dirs: ["."],
75}
76
77cc_defaults {
78    name: "libprofile_static_base_defaults",
79    whole_static_libs: [
80        "libbase",
81        "libz",
82        "libziparchive",
83    ],
84}
85
86cc_defaults {
87    name: "libprofile_static_defaults",
88    defaults: [
89        "libprofile_static_base_defaults",
90        "libartbase_static_defaults",
91        "libdexfile_static_defaults",
92    ],
93    whole_static_libs: ["libprofile"],
94}
95
96cc_defaults {
97    name: "libprofiled_static_defaults",
98    defaults: [
99        "libprofile_static_base_defaults",
100        "libartbased_static_defaults",
101        "libdexfiled_static_defaults",
102    ],
103    whole_static_libs: ["libprofiled"],
104}
105
106art_cc_library {
107    name: "libprofile",
108    defaults: [
109        "libprofile_defaults",
110        "libart_nativeunwind_defaults",
111    ],
112    target: {
113        android: {
114            shared_libs: [
115                "libartbase",
116                "libdexfile#impl",
117            ],
118        },
119        not_windows: {
120            shared_libs: [
121                "libartbase",
122                "libdexfile",
123            ],
124        },
125        windows: {
126            enabled: true,
127            shared: {
128                enabled: false,
129            },
130            static_libs: [
131                "libartbase",
132                "libdexfile",
133            ],
134        },
135    },
136    apex_available: [
137        "com.android.art",
138        "com.android.art.debug",
139        "test_broken_com.android.art",
140    ],
141}
142
143art_cc_library {
144    name: "libprofiled",
145    defaults: [
146        "art_debug_defaults",
147        "libprofile_defaults",
148    ],
149    target: {
150        android: {
151            shared_libs: [
152                "libartbased",
153                "libdexfiled#impl",
154            ],
155        },
156        not_windows: {
157            shared_libs: [
158                "libartbased",
159                "libdexfiled",
160            ],
161        },
162        windows: {
163            static_libs: [
164                "libartbased",
165                "libdexfiled",
166            ],
167        },
168    },
169    apex_available: [
170        "com.android.art.debug",
171    ],
172}
173
174// For now many of these tests still use CommonRuntimeTest, almost universally because of
175// ScratchFile and related.
176// TODO: Remove CommonRuntimeTest dependency from these tests.
177art_cc_defaults {
178    name: "art_libprofile_tests_defaults",
179    device_common_data: [
180        ":art-gtest-jars-ManyMethods",
181        ":art-gtest-jars-MultiDex",
182        ":art-gtest-jars-ProfileTestMultiDex",
183    ],
184    srcs: [
185        "profile/profile_boot_info_test.cc",
186        "profile/profile_compilation_info_test.cc",
187    ],
188}
189
190// Version of ART gtest `art_libprofile_tests` bundled with the ART APEX on target.
191// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
192art_cc_test {
193    name: "art_libprofile_tests",
194    defaults: [
195        "art_gtest_defaults",
196        "art_libprofile_tests_defaults",
197    ],
198}
199
200// Standalone version of ART gtest `art_libprofile_tests`, not bundled with the ART APEX on target.
201art_cc_test {
202    name: "art_standalone_libprofile_tests",
203    defaults: [
204        "art_standalone_gtest_defaults",
205        "art_libprofile_tests_defaults",
206    ],
207}
208