blob: b2c041c81f583b3299e0e533592de5d3018e2bdc [file] [log] [blame]
David Sehr334b9d72018-02-12 18:27:56 -08001//
2// Copyright (C) 2011 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: "libdexfile_defaults",
19 defaults: ["art_defaults"],
20 host_supported: true,
21 srcs: [
David Sehr334b9d72018-02-12 18:27:56 -080022 "dex/compact_dex_file.cc",
Mathieu Chartier5e3cfa22018-02-20 16:53:37 -080023 "dex/compact_offset_table.cc",
David Sehr334b9d72018-02-12 18:27:56 -080024 "dex/descriptors_names.cc",
25 "dex/dex_file.cc",
26 "dex/dex_file_exception_helpers.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080027 "dex/dex_file_layout.cc",
David Sehr334b9d72018-02-12 18:27:56 -080028 "dex/dex_file_loader.cc",
29 "dex/dex_file_tracking_registrar.cc",
30 "dex/dex_file_verifier.cc",
31 "dex/dex_instruction.cc",
32 "dex/modifiers.cc",
David Sehr67bf42e2018-02-26 16:43:04 -080033 "dex/primitive.cc",
David Sehr334b9d72018-02-12 18:27:56 -080034 "dex/standard_dex_file.cc",
David Sehr9c4a0152018-04-05 12:23:54 -070035 "dex/type_lookup_table.cc",
David Sehr334b9d72018-02-12 18:27:56 -080036 "dex/utf.cc",
37 ],
38
39 target: {
40 android: {
41 static_libs: [
42 "libziparchive",
43 "libz",
David Sehr334b9d72018-02-12 18:27:56 -080044 ],
45 shared_libs: [
46 "libutils",
47 ],
48 },
49 host: {
50 shared_libs: [
51 "libziparchive",
52 "libz",
53 ],
54 },
55 },
56 generated_sources: ["dexfile_operator_srcs"],
57 shared_libs: [
David Sehrc431b9d2018-03-02 12:01:51 -080058 // Important note: relying on libartbase's header_lib is perfectly acceptable.
59 // However, relying on the libartbase shared library introduces further, possibly cyclic,
60 // dependencies for clients outside of ART.
David Sehr334b9d72018-02-12 18:27:56 -080061 "liblog",
62 // For common macros.
63 "libbase",
64 "libz",
65 ],
66 header_libs: [
David Sehr67bf42e2018-02-26 16:43:04 -080067 "art_libartbase_headers",
David Sehr334b9d72018-02-12 18:27:56 -080068 ],
69 export_include_dirs: ["."],
70 export_shared_lib_headers: [
71 "libbase",
72 ],
David Sehr67bf42e2018-02-26 16:43:04 -080073 export_header_lib_headers: [
74 "art_libartbase_headers",
75 ],
David Sehr334b9d72018-02-12 18:27:56 -080076}
77
78gensrcs {
79 name: "dexfile_operator_srcs",
Alex Lightb69d2d32018-02-21 13:37:17 -080080 cmd: "$(location generate_operator_out) art/libdexfile $(in) > $(out)",
81 tools: ["generate_operator_out"],
David Sehr334b9d72018-02-12 18:27:56 -080082 srcs: [
83 "dex/dex_file.h",
David Sehrc431b9d2018-03-02 12:01:51 -080084 "dex/dex_file_layout.h",
David Sehr334b9d72018-02-12 18:27:56 -080085 "dex/dex_instruction.h",
86 "dex/dex_instruction_utils.h",
87 "dex/invoke_type.h",
David Sehr312f3b22018-03-19 08:39:26 -070088 "dex/method_reference.h",
David Sehr334b9d72018-02-12 18:27:56 -080089 ],
90 output_extension: "operator_out.cc",
91}
92
David Sehr334b9d72018-02-12 18:27:56 -080093art_cc_library {
94 name: "libdexfile",
95 defaults: ["libdexfile_defaults"],
96 // Leave the symbols in the shared library so that stack unwinders can
97 // produce meaningful name resolution.
98 strip: {
99 keep_symbols: true,
100 },
101}
102
David Sehrfcbe15c2018-02-15 09:41:13 -0800103art_cc_library {
104 name: "libdexfiled",
105 defaults: [
106 "art_debug_defaults",
107 "libdexfile_defaults",
108 ],
109}
110
David Sehr334b9d72018-02-12 18:27:56 -0800111art_cc_test {
112 name: "art_libdexfile_tests",
113 defaults: [
114 "art_gtest_defaults",
115 ],
116 srcs: [
117 "dex/code_item_accessors_test.cc",
David Sehr334b9d72018-02-12 18:27:56 -0800118 "dex/compact_dex_file_test.cc",
Mathieu Chartier5e3cfa22018-02-20 16:53:37 -0800119 "dex/compact_offset_table_test.cc",
David Sehrb2ec9f52018-02-21 13:20:31 -0800120 "dex/descriptors_names_test.cc",
David Sehr312f3b22018-03-19 08:39:26 -0700121 "dex/test_dex_file_builder_test.cc",
David Sehr334b9d72018-02-12 18:27:56 -0800122 "dex/dex_file_loader_test.cc",
123 "dex/dex_file_verifier_test.cc",
124 "dex/dex_instruction_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800125 "dex/primitive_test.cc",
David Sehr312f3b22018-03-19 08:39:26 -0700126 "dex/string_reference_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700127 "dex/type_lookup_table_test.cc",
David Sehr334b9d72018-02-12 18:27:56 -0800128 "dex/utf_test.cc",
129 ],
130 shared_libs: [
131 "libbacktrace",
132 "libziparchive",
133 ],
134 include_dirs: [
135 "external/zlib",
136 ],
137}