| 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: { |
| Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 38 | // Use the 32-bit version of profman on devices. |
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 39 | compile_multilib: "prefer32", |
| Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 40 | shared_libs: [ |
| 41 | "libbase", |
| 42 | ], |
| 43 | }, |
| 44 | host: { |
| 45 | whole_static_libs: [ |
| 46 | "libbase", |
| 47 | ], |
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 48 | }, |
| David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 49 | darwin: { |
| 50 | enabled: true, |
| 51 | }, |
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 52 | }, |
| Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 53 | } |
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 54 | |
| Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 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. |
| 57 | art_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 | ], |
| Martin Stjernholm | a148d61 | 2021-03-30 19:02:39 +0100 | [diff] [blame^] | 67 | target: { |
| 68 | darwin: { |
| 69 | enabled: true, |
| 70 | }, |
| 71 | }, |
| Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | art_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", |
| Andreas Gampe | 3fec9ac | 2016-09-13 10:47:28 -0700 | [diff] [blame] | 83 | ], |
| Martin Stjernholm | a148d61 | 2021-03-30 19:02:39 +0100 | [diff] [blame^] | 84 | target: { |
| 85 | darwin: { |
| 86 | enabled: true, |
| 87 | }, |
| 88 | }, |
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | art_cc_binary { |
| 92 | name: "profman", |
| 93 | defaults: ["profman-defaults"], |
| Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 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 | }, |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 110 | apex_available: [ |
| Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 111 | "com.android.art", |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 112 | "com.android.art.debug", |
| 113 | ], |
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | art_cc_binary { |
| 117 | name: "profmand", |
| 118 | defaults: [ |
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 119 | "art_debug_defaults", |
| Andreas Gampe | 5115efb | 2017-05-24 16:55:54 -0700 | [diff] [blame] | 120 | "profman-defaults", |
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 121 | ], |
| Martin Stjernholm | 39419da | 2021-03-28 22:32:16 +0100 | [diff] [blame] | 122 | target: { |
| 123 | android: { |
| 124 | shared_libs: [ |
| 125 | "libartbased", |
| 126 | "libdexfiled", |
| 127 | "libprofiled", |
| 128 | ], |
| 129 | }, |
| 130 | host: { |
| 131 | // Make the host binary static, except for system libraries. This |
| 132 | // avoids having to bundle host dynamic libs in prebuilts. |
| 133 | static_libs: ["libprofmand_static"], |
| 134 | stl: "c++_static", |
| 135 | |
| 136 | }, |
| 137 | }, |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 138 | apex_available: [ |
| 139 | "com.android.art.debug", |
| 140 | ], |
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 141 | } |
| Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 142 | |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 143 | art_cc_binary { |
| 144 | name: "profmans", |
| 145 | defaults: [ |
| 146 | "profman-defaults", |
| 147 | "libprofile_static_defaults", |
| 148 | "libdexfile_static_defaults", |
| 149 | "libartbase_static_defaults", |
| 150 | ], |
| 151 | host_supported: true, |
| 152 | device_supported: false, |
| 153 | target: { |
| 154 | darwin: { |
| 155 | enabled: false, |
| 156 | }, |
| 157 | windows: { |
| 158 | enabled: true, |
| Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 159 | cflags: ["-Wno-thread-safety"], |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 160 | }, |
| 161 | }, |
| 162 | } |
| 163 | |
| Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 164 | art_cc_test { |
| 165 | name: "art_profman_tests", |
| 166 | defaults: [ |
| Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 167 | "art_gtest_defaults", |
| Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 168 | ], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 169 | shared_libs: [ |
| 170 | "libprofiled", |
| 171 | ], |
| David Srbecky | 4a88a5a | 2020-05-05 16:21:57 +0100 | [diff] [blame] | 172 | data: [ |
| 173 | ":art-gtest-jars-ProfileTestMultiDex", |
| 174 | ], |
| Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 175 | srcs: ["profile_assistant_test.cc"], |
| Yo Chiang | 169dfb4 | 2020-08-07 04:22:18 +0000 | [diff] [blame] | 176 | target: { |
| 177 | host: { |
| 178 | required: ["profmand"], |
| 179 | }, |
| 180 | }, |
| Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 181 | } |