blob: fd32c5fc04813b790b308debca2772e31c7c14f0 [file] [log] [blame]
David Sehr82d046e2018-04-23 08:14:19 -07001//
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
17cc_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 Sehr9d9227a2018-12-19 12:32:50 -080026 shared_libs: [
27 "libartbase",
28 "libdexfile",
29 "libartbase",
30 // For atrace.
31 "libcutils",
32 "libbase",
33 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000034 static_libs: [
35 // ZipArchive support, the order matters here to get all symbols.
36 "libziparchive",
37 "libz",
38 ],
David Sehr9d9227a2018-12-19 12:32:50 -080039 export_shared_lib_headers: ["libbase"],
David Sehr82d046e2018-04-23 08:14:19 -070040 },
David Sehr9d9227a2018-12-19 12:32:50 -080041 not_windows: {
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000042 shared_libs: [
David Sehr9d9227a2018-12-19 12:32:50 -080043 "libartbase",
44 "libdexfile",
45 "libartbase",
46 // For atrace.
47 "libcutils",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000048 "libziparchive",
49 "libz",
David Sehr9d9227a2018-12-19 12:32:50 -080050 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000051 ],
David Sehr9d9227a2018-12-19 12:32:50 -080052 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 Geoffray65ed42a2018-10-30 12:33:04 +000067 },
David Sehr82d046e2018-04-23 08:14:19 -070068 },
Mathieu Chartier818cb802018-05-11 05:30:16 +000069 //generated_sources: ["art_libartbase_operator_srcs"],
David Sehr82d046e2018-04-23 08:14:19 -070070 cflags: ["-DBUILDING_LIBART=1"],
David Sehr82d046e2018-04-23 08:14:19 -070071 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 Sehr82d046e2018-04-23 08:14:19 -070075}
76
Andreas Gampeec5ed062018-01-26 16:20:02 -080077cc_defaults {
78 name: "libprofile_static_base_defaults",
79 static_libs: [
80 "libbase",
81 "libcutils",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000082 "libz",
83 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -080084 ],
85}
86
87cc_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
97cc_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 Sehr82d046e2018-04-23 08:14:19 -0700107art_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 Geoffray65ed42a2018-10-30 12:33:04 +0000117 "libziparchive",
David Sehr82d046e2018-04-23 08:14:19 -0700118 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000119 export_shared_lib_headers: ["libbase"],
David Sehr9d9227a2018-12-19 12:32:50 -0800120 target: {
121 windows: {
122 enabled: true,
123 shared: {
124 enabled: false,
125 },
126 },
127 }
David Sehr82d046e2018-04-23 08:14:19 -0700128}
129
130art_cc_library {
131 name: "libprofiled",
132 defaults: [
133 "art_debug_defaults",
134 "libprofile_defaults",
135 ],
136 shared_libs: [
137 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000138 "libziparchive",
David Sehr82d046e2018-04-23 08:14:19 -0700139 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000140 export_shared_lib_headers: ["libbase"],
David Sehr82d046e2018-04-23 08:14:19 -0700141}
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.
146art_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 Sehr1f010162018-05-15 08:59:32 -0700157 "libartbased",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000158 "libziparchive",
David Sehr82d046e2018-04-23 08:14:19 -0700159 ],
160}