Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 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 | |
Bob Badour | 9150de6 | 2021-02-26 03:22:24 -0800 | [diff] [blame] | 17 | package { |
| 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 Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 26 | cc_defaults { |
| 27 | name: "profman-defaults", |
| 28 | host_supported: true, |
| 29 | defaults: ["art_defaults"], |
| 30 | srcs: [ |
Mathieu Chartier | 2f79455 | 2017-06-19 10:58:08 -0700 | [diff] [blame] | 31 | "boot_image_profile.cc", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 32 | "profman.cc", |
| 33 | "profile_assistant.cc", |
| 34 | ], |
| 35 | |
| 36 | target: { |
| 37 | android: { |
Orion Hodson | 0e85853 | 2021-08-02 21:16:05 +0100 | [diff] [blame] | 38 | compile_multilib: "first", |
Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 39 | shared_libs: [ |
| 40 | "libbase", |
| 41 | ], |
| 42 | }, |
| 43 | host: { |
| 44 | whole_static_libs: [ |
| 45 | "libbase", |
| 46 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 47 | }, |
David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 48 | darwin: { |
| 49 | enabled: true, |
| 50 | }, |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 51 | }, |
Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 52 | } |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 53 | |
Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 54 | // Collect all the static defaults and build a host-only static library, which |
| 55 | // is then used for the (mostly) static host profman binary. |
| 56 | art_cc_library_static { |
| 57 | name: "libprofman_static", |
| 58 | device_supported: false, |
| 59 | host_supported: true, |
| 60 | defaults: [ |
| 61 | "art_defaults", |
| 62 | "libartbase_static_defaults", |
| 63 | "libdexfile_static_defaults", |
| 64 | "libprofile_static_defaults", |
| 65 | ], |
Martin Stjernholm | a148d61 | 2021-03-30 19:02:39 +0100 | [diff] [blame] | 66 | target: { |
| 67 | darwin: { |
| 68 | enabled: true, |
| 69 | }, |
| 70 | }, |
Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | art_cc_library_static { |
| 74 | name: "libprofmand_static", |
| 75 | device_supported: false, |
| 76 | host_supported: true, |
| 77 | defaults: [ |
| 78 | "art_debug_defaults", |
| 79 | "libartbased_static_defaults", |
| 80 | "libdexfiled_static_defaults", |
| 81 | "libprofiled_static_defaults", |
Andreas Gampe | 3fec9ac | 2016-09-13 10:47:28 -0700 | [diff] [blame] | 82 | ], |
Martin Stjernholm | a148d61 | 2021-03-30 19:02:39 +0100 | [diff] [blame] | 83 | target: { |
| 84 | darwin: { |
| 85 | enabled: true, |
| 86 | }, |
| 87 | }, |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | art_cc_binary { |
| 91 | name: "profman", |
| 92 | defaults: ["profman-defaults"], |
Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 93 | target: { |
| 94 | android: { |
| 95 | shared_libs: [ |
| 96 | "libartbase", |
| 97 | "libdexfile", |
| 98 | "libprofile", |
| 99 | ], |
| 100 | }, |
| 101 | host: { |
| 102 | // Make the host binary static, except for system libraries. This |
| 103 | // avoids having to bundle host dynamic libs in prebuilts. |
| 104 | static_libs: ["libprofman_static"], |
| 105 | stl: "c++_static", |
| 106 | |
| 107 | }, |
| 108 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 109 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 110 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 111 | "com.android.art.debug", |
| 112 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | art_cc_binary { |
| 116 | name: "profmand", |
| 117 | defaults: [ |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 118 | "art_debug_defaults", |
Andreas Gampe | 5115efb | 2017-05-24 16:55:54 -0700 | [diff] [blame] | 119 | "profman-defaults", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 120 | ], |
Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 121 | target: { |
| 122 | android: { |
| 123 | shared_libs: [ |
| 124 | "libartbased", |
| 125 | "libdexfiled", |
| 126 | "libprofiled", |
| 127 | ], |
| 128 | }, |
| 129 | host: { |
| 130 | // Make the host binary static, except for system libraries. This |
| 131 | // avoids having to bundle host dynamic libs in prebuilts. |
| 132 | static_libs: ["libprofmand_static"], |
| 133 | stl: "c++_static", |
| 134 | |
| 135 | }, |
| 136 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 137 | apex_available: [ |
| 138 | "com.android.art.debug", |
| 139 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 140 | } |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 141 | |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 142 | art_cc_binary { |
| 143 | name: "profmans", |
| 144 | defaults: [ |
| 145 | "profman-defaults", |
| 146 | "libprofile_static_defaults", |
| 147 | "libdexfile_static_defaults", |
| 148 | "libartbase_static_defaults", |
| 149 | ], |
| 150 | host_supported: true, |
| 151 | device_supported: false, |
| 152 | target: { |
| 153 | darwin: { |
| 154 | enabled: false, |
| 155 | }, |
| 156 | windows: { |
| 157 | enabled: true, |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 158 | cflags: ["-Wno-thread-safety"], |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 159 | }, |
| 160 | }, |
| 161 | } |
| 162 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 163 | art_cc_defaults { |
| 164 | name: "art_profman_tests_defaults", |
David Srbecky | 4a88a5a | 2020-05-05 16:21:57 +0100 | [diff] [blame] | 165 | data: [ |
| 166 | ":art-gtest-jars-ProfileTestMultiDex", |
| 167 | ], |
Chih-Hung Hsieh | a0a5f00 | 2022-02-17 21:14:37 -0800 | [diff] [blame] | 168 | tidy_timeout_srcs: ["profile_assistant_test.cc"], |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 169 | srcs: ["profile_assistant_test.cc"], |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | // Version of ART gtest `art_profman_tests` bundled with the ART APEX on target. |
| 173 | // TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. |
| 174 | art_cc_test { |
| 175 | name: "art_profman_tests", |
| 176 | defaults: [ |
| 177 | "art_gtest_defaults", |
| 178 | "art_profman_tests_defaults", |
| 179 | ], |
| 180 | shared_libs: [ |
| 181 | "libprofiled", |
| 182 | ], |
Yo Chiang | 169dfb4 | 2020-08-07 04:22:18 +0000 | [diff] [blame] | 183 | target: { |
| 184 | host: { |
| 185 | required: ["profmand"], |
| 186 | }, |
| 187 | }, |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 188 | } |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 189 | |
| 190 | // Standalone version of ART gtest `art_profman_tests`, not bundled with the ART APEX on target. |
| 191 | art_cc_test { |
| 192 | name: "art_standalone_profman_tests", |
| 193 | defaults: [ |
| 194 | "art_standalone_gtest_defaults", |
| 195 | "art_profman_tests_defaults", |
| 196 | ], |
Jiakai Zhang | d539f86 | 2022-02-08 14:56:05 +0000 | [diff] [blame] | 197 | data: [":generate-boot-image"], |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 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 | } |