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