| 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"], |
| 20 | host_supported: true, |
| 21 | srcs: [ |
| 22 | "profile/profile_compilation_info.cc", |
| 23 | ], |
| 24 | target: { |
| 25 | android: { |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 26 | shared_libs: [ |
| 27 | "libartbase", |
| 28 | "libdexfile", |
| 29 | "libartbase", |
| 30 | // For atrace. |
| 31 | "libcutils", |
| 32 | "libbase", |
| 33 | ], |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 34 | static_libs: [ |
| 35 | // ZipArchive support, the order matters here to get all symbols. |
| 36 | "libziparchive", |
| 37 | "libz", |
| 38 | ], |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 39 | export_shared_lib_headers: ["libbase"], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 40 | }, |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 41 | not_windows: { |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 42 | shared_libs: [ |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 43 | "libartbase", |
| 44 | "libdexfile", |
| 45 | "libartbase", |
| 46 | // For atrace. |
| 47 | "libcutils", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 48 | "libziparchive", |
| 49 | "libz", |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 50 | "libbase", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 51 | ], |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 52 | export_shared_lib_headers: ["libbase"], |
| 53 | }, |
| 54 | windows: { |
| 55 | cflags: ["-Wno-thread-safety"], |
| 56 | static_libs: [ |
| 57 | "libartbase", |
| 58 | "libdexfile", |
| 59 | "libartbase", |
| 60 | // For atrace. |
| 61 | "libcutils", |
| 62 | "libziparchive", |
| 63 | "libz", |
| 64 | "libbase", |
| 65 | ], |
| 66 | export_static_lib_headers: ["libbase"], |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 67 | }, |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 68 | }, |
| Mathieu Chartier | 818cb80 | 2018-05-11 05:30:16 +0000 | [diff] [blame] | 69 | //generated_sources: ["art_libartbase_operator_srcs"], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 70 | cflags: ["-DBUILDING_LIBART=1"], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 71 | export_include_dirs: ["."], |
| 72 | // ART's macros.h depends on libbase's macros.h. |
| 73 | // Note: runtime_options.h depends on cmdline. But we don't really want to export this |
| 74 | // generically. dex2oat takes care of it itself. |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 77 | cc_defaults { |
| 78 | name: "libprofile_static_base_defaults", |
| 79 | static_libs: [ |
| 80 | "libbase", |
| 81 | "libcutils", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 82 | "libz", |
| 83 | "libziparchive", |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 84 | ], |
| 85 | } |
| 86 | |
| 87 | cc_defaults { |
| 88 | name: "libprofile_static_defaults", |
| 89 | defaults: [ |
| 90 | "libprofile_static_base_defaults", |
| 91 | "libartbase_static_defaults", |
| 92 | "libdexfile_static_defaults", |
| 93 | ], |
| 94 | static_libs: ["libprofile"], |
| 95 | } |
| 96 | |
| 97 | cc_defaults { |
| 98 | name: "libprofiled_static_defaults", |
| 99 | defaults: [ |
| 100 | "libprofile_static_base_defaults", |
| 101 | "libartbased_static_defaults", |
| 102 | "libdexfiled_static_defaults", |
| 103 | ], |
| 104 | static_libs: ["libprofiled"], |
| 105 | } |
| 106 | |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 107 | art_cc_library { |
| 108 | name: "libprofile", |
| 109 | defaults: ["libprofile_defaults"], |
| 110 | // Leave the symbols in the shared library so that stack unwinders can |
| 111 | // produce meaningful name resolution. |
| 112 | strip: { |
| 113 | keep_symbols: true, |
| 114 | }, |
| 115 | shared_libs: [ |
| 116 | "libbase", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 117 | "libziparchive", |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 118 | ], |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 119 | export_shared_lib_headers: ["libbase"], |
| David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 120 | target: { |
| 121 | windows: { |
| 122 | enabled: true, |
| 123 | shared: { |
| 124 | enabled: false, |
| 125 | }, |
| 126 | }, |
| 127 | } |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | art_cc_library { |
| 131 | name: "libprofiled", |
| 132 | defaults: [ |
| 133 | "art_debug_defaults", |
| 134 | "libprofile_defaults", |
| 135 | ], |
| 136 | shared_libs: [ |
| 137 | "libbase", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 138 | "libziparchive", |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 139 | ], |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 140 | export_shared_lib_headers: ["libbase"], |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | // For now many of these tests still use CommonRuntimeTest, almost universally because of |
| 144 | // ScratchFile and related. |
| 145 | // TODO: Remove CommonRuntimeTest dependency from these tests. |
| 146 | art_cc_test { |
| 147 | name: "art_libprofile_tests", |
| 148 | defaults: [ |
| 149 | "art_gtest_defaults", |
| 150 | ], |
| 151 | srcs: [ |
| 152 | "profile/profile_compilation_info_test.cc", |
| 153 | ], |
| 154 | shared_libs: [ |
| 155 | "libartbased", |
| 156 | "libdexfiled", |
| David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 157 | "libartbased", |
| Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 158 | "libziparchive", |
| David Sehr | 82d046e | 2018-04-23 08:14:19 -0700 | [diff] [blame] | 159 | ], |
| 160 | } |