| 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 | |
| 17 | cc_defaults { |
| 18 | name: "libprofile_defaults", |
| 19 | defaults: ["art_defaults"], |
| Martin Stjernholm | 75b961a | 2020-05-07 01:45:27 +0100 | [diff] [blame] | 20 | visibility: [ |
| 21 | // Visibility for prebuilt binaries from the prebuilt of this module. |
| 22 | // TODO(b/155921753): Restrict this when prebuilts are in their proper |
| 23 | // locations. |
| 24 | "//prebuilts:__subpackages__", |
| 25 | ], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 26 | host_supported: true, |
| 27 | srcs: [ |
| Nicolas Geoffray | a0fc13a | 2019-07-23 15:48:39 +0100 | [diff] [blame] | 28 | "profile/profile_boot_info.cc", |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 29 | "profile/profile_compilation_info.cc", |
| 30 | ], |
| 31 | target: { |
| 32 | android: { |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 33 | shared_libs: [ |
| Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 34 | "libartpalette", |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 35 | "libbase", |
| 36 | ], |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 37 | static_libs: [ |
| 38 | // ZipArchive support, the order matters here to get all symbols. |
| 39 | "libziparchive", |
| 40 | "libz", |
| 41 | ], |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 42 | export_shared_lib_headers: ["libbase"], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 43 | }, |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 44 | not_windows: { |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 45 | shared_libs: [ |
| Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 46 | "libartpalette", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 47 | "libziparchive", |
| 48 | "libz", |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 49 | "libbase", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 50 | ], |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 51 | export_shared_lib_headers: ["libbase"], |
| 52 | }, |
| 53 | windows: { |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 54 | cflags: ["-Wno-thread-safety"], |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 55 | static_libs: [ |
| Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 56 | "libartpalette", |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 57 | "libziparchive", |
| 58 | "libz", |
| 59 | "libbase", |
| 60 | ], |
| 61 | export_static_lib_headers: ["libbase"], |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 62 | }, |
| David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 63 | darwin: { |
| 64 | enabled: true, |
| 65 | }, |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 66 | }, |
| Mathieu Chartier | 818cb80 | 2018-05-11 05:30:16 +0000 | [diff] [blame] | 67 | //generated_sources: ["art_libartbase_operator_srcs"], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 68 | cflags: ["-DBUILDING_LIBART=1"], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 69 | export_include_dirs: ["."], |
| 70 | // ART's macros.h depends on libbase's macros.h. |
| 71 | // Note: runtime_options.h depends on cmdline. But we don't really want to export this |
| 72 | // generically. dex2oat takes care of it itself. |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 73 | } |
| 74 | |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 75 | cc_defaults { |
| 76 | name: "libprofile_static_base_defaults", |
| 77 | static_libs: [ |
| 78 | "libbase", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 79 | "libz", |
| 80 | "libziparchive", |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 81 | ], |
| 82 | } |
| 83 | |
| 84 | cc_defaults { |
| 85 | name: "libprofile_static_defaults", |
| 86 | defaults: [ |
| 87 | "libprofile_static_base_defaults", |
| 88 | "libartbase_static_defaults", |
| 89 | "libdexfile_static_defaults", |
| 90 | ], |
| 91 | static_libs: ["libprofile"], |
| 92 | } |
| 93 | |
| 94 | cc_defaults { |
| 95 | name: "libprofiled_static_defaults", |
| 96 | defaults: [ |
| 97 | "libprofile_static_base_defaults", |
| 98 | "libartbased_static_defaults", |
| 99 | "libdexfiled_static_defaults", |
| 100 | ], |
| 101 | static_libs: ["libprofiled"], |
| 102 | } |
| 103 | |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 104 | art_cc_library { |
| 105 | name: "libprofile", |
| Christopher Ferris | 0d38e85 | 2019-12-11 09:37:19 -0800 | [diff] [blame] | 106 | defaults: [ |
| 107 | "libprofile_defaults", |
| 108 | "libart_nativeunwind_defaults", |
| 109 | ], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 110 | shared_libs: [ |
| 111 | "libbase", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 112 | "libziparchive", |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 113 | ], |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 114 | export_shared_lib_headers: ["libbase"], |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 115 | target: { |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 116 | android: { |
| 117 | shared_libs: [ |
| 118 | "libartbase", |
| 119 | "libdexfile", |
| 120 | ], |
| 121 | }, |
| 122 | not_windows: { |
| 123 | shared_libs: [ |
| 124 | "libartbase", |
| 125 | "libdexfile", |
| 126 | ], |
| 127 | }, |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 128 | windows: { |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 129 | enabled: true, |
| 130 | shared: { |
| 131 | enabled: false, |
| 132 | }, |
| 133 | static_libs: [ |
| 134 | "libartbase", |
| 135 | "libdexfile", |
| 136 | ], |
| 137 | }, |
| 138 | }, |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 139 | apex_available: [ |
| 140 | "com.android.art.release", |
| 141 | "com.android.art.debug", |
| 142 | ], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | art_cc_library { |
| 146 | name: "libprofiled", |
| 147 | defaults: [ |
| 148 | "art_debug_defaults", |
| 149 | "libprofile_defaults", |
| 150 | ], |
| 151 | shared_libs: [ |
| 152 | "libbase", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 153 | "libziparchive", |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 154 | ], |
| David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 155 | target: { |
| 156 | android: { |
| 157 | shared_libs: [ |
| 158 | "libartbased", |
| 159 | "libdexfiled", |
| 160 | ], |
| 161 | }, |
| 162 | not_windows: { |
| 163 | shared_libs: [ |
| 164 | "libartbased", |
| 165 | "libdexfiled", |
| 166 | ], |
| 167 | }, |
| 168 | windows: { |
| 169 | static_libs: [ |
| 170 | "libartbased", |
| 171 | "libdexfiled", |
| 172 | ], |
| 173 | }, |
| 174 | }, |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 175 | export_shared_lib_headers: ["libbase"], |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 176 | apex_available: [ |
| 177 | "com.android.art.debug", |
| 178 | ], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | // For now many of these tests still use CommonRuntimeTest, almost universally because of |
| 182 | // ScratchFile and related. |
| 183 | // TODO: Remove CommonRuntimeTest dependency from these tests. |
| 184 | art_cc_test { |
| 185 | name: "art_libprofile_tests", |
| 186 | defaults: [ |
| 187 | "art_gtest_defaults", |
| 188 | ], |
| 189 | srcs: [ |
| Nicolas Geoffray | a0fc13a | 2019-07-23 15:48:39 +0100 | [diff] [blame] | 190 | "profile/profile_boot_info_test.cc", |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 191 | "profile/profile_compilation_info_test.cc", |
| 192 | ], |
| 193 | shared_libs: [ |
| 194 | "libartbased", |
| 195 | "libdexfiled", |
| David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 196 | "libartbased", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 197 | "libziparchive", |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 198 | ], |
| 199 | } |