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 default_team: "trendy_team_art_performance", 25} 26 27cc_defaults { 28 name: "profman-defaults", 29 host_supported: true, 30 defaults: ["art_defaults"], 31 srcs: [ 32 "boot_image_profile.cc", 33 "profman.cc", 34 "profile_assistant.cc", 35 ], 36 header_libs: ["profman_headers"], 37 38 target: { 39 android: { 40 compile_multilib: "first", 41 shared_libs: [ 42 "libbase", 43 ], 44 }, 45 host: { 46 whole_static_libs: [ 47 "libbase", 48 ], 49 }, 50 darwin: { 51 enabled: true, 52 }, 53 }, 54} 55 56// Collect all the static defaults and build a host-only static library, which 57// is then used for the (mostly) static host profman binary. 58art_cc_library_static { 59 name: "libprofman_static", 60 device_supported: false, 61 host_supported: true, 62 defaults: [ 63 "art_defaults", 64 "libartbase_static_defaults", 65 "libdexfile_static_defaults", 66 "libprofile_static_defaults", 67 ], 68 target: { 69 darwin: { 70 enabled: true, 71 }, 72 }, 73} 74 75art_cc_library_static { 76 name: "libprofmand_static", 77 device_supported: false, 78 host_supported: true, 79 defaults: [ 80 "art_debug_defaults", 81 "libartbased_static_defaults", 82 "libdexfiled_static_defaults", 83 "libprofiled_static_defaults", 84 ], 85 target: { 86 darwin: { 87 enabled: true, 88 }, 89 }, 90} 91 92art_cc_binary { 93 name: "profman", 94 defaults: ["profman-defaults"], 95 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 }, 111 apex_available: [ 112 "com.android.art", 113 "com.android.art.debug", 114 "test_broken_com.android.art", 115 ], 116} 117 118art_cc_binary { 119 name: "profmand", 120 defaults: [ 121 "art_debug_defaults", 122 "profman-defaults", 123 ], 124 target: { 125 android: { 126 shared_libs: [ 127 "libartbased", 128 "libdexfiled", 129 "libprofiled", 130 ], 131 }, 132 host: { 133 // Make the host binary static, except for system libraries. This 134 // avoids having to bundle host dynamic libs in prebuilts. 135 static_libs: ["libprofmand_static"], 136 stl: "c++_static", 137 138 }, 139 }, 140 apex_available: [ 141 "com.android.art.debug", 142 ], 143} 144 145art_cc_binary { 146 name: "profmans", 147 defaults: [ 148 "profman-defaults", 149 "libprofile_static_defaults", 150 "libdexfile_static_defaults", 151 "libartbase_static_defaults", 152 ], 153 host_supported: true, 154 device_supported: false, 155 target: { 156 darwin: { 157 enabled: false, 158 }, 159 windows: { 160 enabled: true, 161 cflags: ["-Wno-thread-safety"], 162 }, 163 }, 164} 165 166cc_library_headers { 167 name: "profman_headers", 168 defaults: ["art_defaults"], 169 export_include_dirs: ["include"], 170 host_supported: true, 171 target: { 172 darwin: { 173 enabled: false, 174 }, 175 windows: { 176 enabled: true, 177 }, 178 }, 179 apex_available: [ 180 "com.android.art", 181 "com.android.art.debug", 182 ], 183} 184 185art_cc_defaults { 186 name: "art_profman_tests_defaults", 187 data: [ 188 ":art-gtest-jars-ProfileTestMultiDex", 189 ], 190 header_libs: ["profman_headers"], 191 tidy_timeout_srcs: ["profile_assistant_test.cc"], 192 srcs: ["profile_assistant_test.cc"], 193} 194 195// Version of ART gtest `art_profman_tests` bundled with the ART APEX on target. 196// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. 197art_cc_test { 198 name: "art_profman_tests", 199 defaults: [ 200 "art_gtest_defaults", 201 "art_profman_tests_defaults", 202 ], 203 target: { 204 host: { 205 required: ["profmand"], 206 }, 207 }, 208} 209 210// Standalone version of ART gtest `art_profman_tests`, not bundled with the ART APEX on target. 211art_cc_test { 212 name: "art_standalone_profman_tests", 213 defaults: [ 214 "art_standalone_gtest_defaults", 215 "art_profman_tests_defaults", 216 ], 217 data: [":generate-boot-image"], 218 target: { 219 host: { 220 required: ["profman"], 221 }, 222 }, 223 test_config_template: "art_standalone_profman_tests.xml", 224} 225