David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 1 | // |
| 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 | |
| 17 | cc_defaults { |
| 18 | name: "libdexfile_defaults", |
| 19 | defaults: ["art_defaults"], |
| 20 | host_supported: true, |
| 21 | srcs: [ |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 22 | "dex/compact_dex_file.cc", |
Mathieu Chartier | 5e3cfa2 | 2018-02-20 16:53:37 -0800 | [diff] [blame] | 23 | "dex/compact_offset_table.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 24 | "dex/descriptors_names.cc", |
| 25 | "dex/dex_file.cc", |
| 26 | "dex/dex_file_exception_helpers.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 27 | "dex/dex_file_layout.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 28 | "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 Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 33 | "dex/primitive.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 34 | "dex/standard_dex_file.cc", |
| 35 | "dex/utf.cc", |
| 36 | ], |
| 37 | |
| 38 | target: { |
| 39 | android: { |
| 40 | static_libs: [ |
| 41 | "libziparchive", |
| 42 | "libz", |
| 43 | "libbase", |
| 44 | ], |
| 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 Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 58 | // 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 Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 61 | "liblog", |
| 62 | // For common macros. |
| 63 | "libbase", |
| 64 | "libz", |
| 65 | ], |
| 66 | header_libs: [ |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 67 | "art_libartbase_headers", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 68 | ], |
| 69 | export_include_dirs: ["."], |
| 70 | export_shared_lib_headers: [ |
| 71 | "libbase", |
| 72 | ], |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 73 | export_header_lib_headers: [ |
| 74 | "art_libartbase_headers", |
| 75 | ], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | gensrcs { |
| 79 | name: "dexfile_operator_srcs", |
Alex Light | b69d2d3 | 2018-02-21 13:37:17 -0800 | [diff] [blame] | 80 | cmd: "$(location generate_operator_out) art/libdexfile $(in) > $(out)", |
| 81 | tools: ["generate_operator_out"], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 82 | srcs: [ |
| 83 | "dex/dex_file.h", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 84 | "dex/dex_file_layout.h", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 85 | "dex/dex_instruction.h", |
| 86 | "dex/dex_instruction_utils.h", |
| 87 | "dex/invoke_type.h", |
| 88 | ], |
| 89 | output_extension: "operator_out.cc", |
| 90 | } |
| 91 | |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 92 | art_cc_library { |
| 93 | name: "libdexfile", |
| 94 | defaults: ["libdexfile_defaults"], |
| 95 | // Leave the symbols in the shared library so that stack unwinders can |
| 96 | // produce meaningful name resolution. |
| 97 | strip: { |
| 98 | keep_symbols: true, |
| 99 | }, |
| 100 | } |
| 101 | |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 102 | art_cc_library { |
| 103 | name: "libdexfiled", |
| 104 | defaults: [ |
| 105 | "art_debug_defaults", |
| 106 | "libdexfile_defaults", |
| 107 | ], |
| 108 | } |
| 109 | |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 110 | art_cc_test { |
| 111 | name: "art_libdexfile_tests", |
| 112 | defaults: [ |
| 113 | "art_gtest_defaults", |
| 114 | ], |
| 115 | srcs: [ |
| 116 | "dex/code_item_accessors_test.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 117 | "dex/compact_dex_file_test.cc", |
Mathieu Chartier | 5e3cfa2 | 2018-02-20 16:53:37 -0800 | [diff] [blame] | 118 | "dex/compact_offset_table_test.cc", |
David Sehr | b2ec9f5 | 2018-02-21 13:20:31 -0800 | [diff] [blame] | 119 | "dex/descriptors_names_test.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 120 | "dex/dex_file_loader_test.cc", |
| 121 | "dex/dex_file_verifier_test.cc", |
| 122 | "dex/dex_instruction_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 123 | "dex/primitive_test.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 124 | "dex/utf_test.cc", |
| 125 | ], |
| 126 | shared_libs: [ |
| 127 | "libbacktrace", |
| 128 | "libziparchive", |
| 129 | ], |
| 130 | include_dirs: [ |
| 131 | "external/zlib", |
| 132 | ], |
| 133 | } |