David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 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 | |
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 | |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 26 | cc_defaults { |
| 27 | name: "libprofile_defaults", |
| 28 | defaults: ["art_defaults"], |
| 29 | host_supported: true, |
| 30 | srcs: [ |
Nicolas Geoffray | a0fc13a | 2019-07-23 15:48:39 +0100 | [diff] [blame] | 31 | "profile/profile_boot_info.cc", |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 32 | "profile/profile_compilation_info.cc", |
| 33 | ], |
| 34 | target: { |
| 35 | android: { |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 36 | shared_libs: [ |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 37 | "libartpalette", |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 38 | "libbase", |
Jiyong Park | b1c8e16 | 2020-05-18 19:04:42 +0900 | [diff] [blame] | 39 | "libz", |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 40 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 41 | static_libs: [ |
| 42 | // ZipArchive support, the order matters here to get all symbols. |
| 43 | "libziparchive", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 44 | ], |
Martin Stjernholm | e407d97 | 2020-09-17 01:31:10 +0100 | [diff] [blame] | 45 | export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h. |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 46 | }, |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 47 | not_windows: { |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 48 | shared_libs: [ |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 49 | "libartpalette", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 50 | "libziparchive", |
| 51 | "libz", |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 52 | "libbase", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 53 | ], |
Martin Stjernholm | e407d97 | 2020-09-17 01:31:10 +0100 | [diff] [blame] | 54 | export_shared_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h. |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 55 | }, |
| 56 | windows: { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 57 | cflags: ["-Wno-thread-safety"], |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 58 | static_libs: [ |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 59 | "libartpalette", |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 60 | "libziparchive", |
| 61 | "libz", |
| 62 | "libbase", |
| 63 | ], |
Martin Stjernholm | e407d97 | 2020-09-17 01:31:10 +0100 | [diff] [blame] | 64 | export_static_lib_headers: ["libbase"], // ART's macros.h depends on libbase's macros.h. |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 65 | }, |
David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 66 | darwin: { |
| 67 | enabled: true, |
| 68 | }, |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 69 | }, |
Mathieu Chartier | 818cb80 | 2018-05-11 05:30:16 +0000 | [diff] [blame] | 70 | //generated_sources: ["art_libartbase_operator_srcs"], |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 71 | export_include_dirs: ["."], |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 72 | } |
| 73 | |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 74 | cc_defaults { |
| 75 | name: "libprofile_static_base_defaults", |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 76 | whole_static_libs: [ |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 77 | "libbase", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 78 | "libz", |
| 79 | "libziparchive", |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 80 | ], |
| 81 | } |
| 82 | |
| 83 | cc_defaults { |
| 84 | name: "libprofile_static_defaults", |
| 85 | defaults: [ |
| 86 | "libprofile_static_base_defaults", |
| 87 | "libartbase_static_defaults", |
| 88 | "libdexfile_static_defaults", |
| 89 | ], |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 90 | whole_static_libs: ["libprofile"], |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | cc_defaults { |
| 94 | name: "libprofiled_static_defaults", |
| 95 | defaults: [ |
| 96 | "libprofile_static_base_defaults", |
| 97 | "libartbased_static_defaults", |
| 98 | "libdexfiled_static_defaults", |
| 99 | ], |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 100 | whole_static_libs: ["libprofiled"], |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 101 | } |
| 102 | |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 103 | art_cc_library { |
| 104 | name: "libprofile", |
Christopher Ferris | 0d38e85 | 2019-12-11 09:37:19 -0800 | [diff] [blame] | 105 | defaults: [ |
| 106 | "libprofile_defaults", |
| 107 | "libart_nativeunwind_defaults", |
| 108 | ], |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 109 | shared_libs: [ |
| 110 | "libbase", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 111 | "libziparchive", |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 112 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 113 | export_shared_lib_headers: ["libbase"], |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 114 | target: { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 115 | android: { |
| 116 | shared_libs: [ |
| 117 | "libartbase", |
| 118 | "libdexfile", |
| 119 | ], |
| 120 | }, |
| 121 | not_windows: { |
| 122 | shared_libs: [ |
| 123 | "libartbase", |
| 124 | "libdexfile", |
| 125 | ], |
| 126 | }, |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 127 | windows: { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 128 | enabled: true, |
| 129 | shared: { |
| 130 | enabled: false, |
| 131 | }, |
| 132 | static_libs: [ |
| 133 | "libartbase", |
| 134 | "libdexfile", |
| 135 | ], |
| 136 | }, |
| 137 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 138 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 139 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 140 | "com.android.art.debug", |
| 141 | ], |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | art_cc_library { |
| 145 | name: "libprofiled", |
| 146 | defaults: [ |
| 147 | "art_debug_defaults", |
| 148 | "libprofile_defaults", |
| 149 | ], |
| 150 | shared_libs: [ |
| 151 | "libbase", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 152 | "libziparchive", |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 153 | ], |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 154 | target: { |
| 155 | android: { |
| 156 | shared_libs: [ |
| 157 | "libartbased", |
| 158 | "libdexfiled", |
| 159 | ], |
| 160 | }, |
| 161 | not_windows: { |
| 162 | shared_libs: [ |
| 163 | "libartbased", |
| 164 | "libdexfiled", |
| 165 | ], |
| 166 | }, |
| 167 | windows: { |
| 168 | static_libs: [ |
| 169 | "libartbased", |
| 170 | "libdexfiled", |
| 171 | ], |
| 172 | }, |
| 173 | }, |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 174 | export_shared_lib_headers: ["libbase"], |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 175 | apex_available: [ |
| 176 | "com.android.art.debug", |
Martin Stjernholm | a2f48a4 | 2021-04-09 13:23:21 +0100 | [diff] [blame] | 177 | // TODO(b/183882457): This lib doesn't go into com.android.art, but |
| 178 | // apex_available lists need to be the same for internal libs to avoid |
| 179 | // stubs, and libartd depends on this. |
| 180 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 181 | ], |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | // For now many of these tests still use CommonRuntimeTest, almost universally because of |
| 185 | // ScratchFile and related. |
| 186 | // TODO: Remove CommonRuntimeTest dependency from these tests. |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 187 | art_cc_defaults { |
| 188 | name: "art_libprofile_tests_defaults", |
David Srbecky | 4a88a5a | 2020-05-05 16:21:57 +0100 | [diff] [blame] | 189 | data: [ |
| 190 | ":art-gtest-jars-ManyMethods", |
| 191 | ":art-gtest-jars-MultiDex", |
| 192 | ":art-gtest-jars-ProfileTestMultiDex", |
| 193 | ], |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 194 | srcs: [ |
Nicolas Geoffray | a0fc13a | 2019-07-23 15:48:39 +0100 | [diff] [blame] | 195 | "profile/profile_boot_info_test.cc", |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 196 | "profile/profile_compilation_info_test.cc", |
| 197 | ], |
| 198 | shared_libs: [ |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 199 | "libziparchive", |
David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 200 | ], |
| 201 | } |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 202 | |
| 203 | // Version of ART gtest `art_libprofile_tests` bundled with the ART APEX on target. |
| 204 | // TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. |
| 205 | art_cc_test { |
| 206 | name: "art_libprofile_tests", |
| 207 | defaults: [ |
| 208 | "art_gtest_defaults", |
| 209 | "art_libprofile_tests_defaults", |
| 210 | ], |
| 211 | shared_libs: [ |
| 212 | "libartbased", |
| 213 | "libdexfiled", |
| 214 | ], |
| 215 | } |
| 216 | |
| 217 | // Standalone version of ART gtest `art_libprofile_tests`, not bundled with the ART APEX on target. |
| 218 | art_cc_test { |
| 219 | name: "art_standalone_libprofile_tests", |
| 220 | defaults: [ |
| 221 | "art_standalone_gtest_defaults", |
| 222 | "art_libprofile_tests_defaults", |
| 223 | ], |
| 224 | shared_libs: [ |
| 225 | "libartbase", |
| 226 | "libdexfile", |
| 227 | ], |
| 228 | test_config: "art_standalone_libprofile_tests.xml", |
| 229 | } |