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 | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 22 | "dex/art_dex_file_loader.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 23 | "dex/compact_dex_file.cc", |
Mathieu Chartier | 5e3cfa2 | 2018-02-20 16:53:37 -0800 | [diff] [blame] | 24 | "dex/compact_offset_table.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 25 | "dex/descriptors_names.cc", |
| 26 | "dex/dex_file.cc", |
| 27 | "dex/dex_file_exception_helpers.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 28 | "dex/dex_file_layout.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 29 | "dex/dex_file_loader.cc", |
| 30 | "dex/dex_file_tracking_registrar.cc", |
| 31 | "dex/dex_file_verifier.cc", |
| 32 | "dex/dex_instruction.cc", |
| 33 | "dex/modifiers.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 34 | "dex/primitive.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 35 | "dex/standard_dex_file.cc", |
David Sehr | 9c4a015 | 2018-04-05 12:23:54 -0700 | [diff] [blame] | 36 | "dex/type_lookup_table.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 37 | "dex/utf.cc", |
| 38 | ], |
| 39 | |
| 40 | target: { |
| 41 | android: { |
| 42 | static_libs: [ |
| 43 | "libziparchive", |
| 44 | "libz", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 45 | ], |
| 46 | shared_libs: [ |
| 47 | "libutils", |
| 48 | ], |
| 49 | }, |
| 50 | host: { |
| 51 | shared_libs: [ |
| 52 | "libziparchive", |
| 53 | "libz", |
| 54 | ], |
| 55 | }, |
| 56 | }, |
| 57 | generated_sources: ["dexfile_operator_srcs"], |
| 58 | shared_libs: [ |
David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 59 | // For MemMap. |
David Sehr | 2300b2d | 2018-05-10 14:20:10 -0700 | [diff] [blame] | 60 | "libartbase", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 61 | "liblog", |
David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 62 | // For atrace. |
| 63 | "libcutils", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 64 | // For common macros. |
| 65 | "libbase", |
| 66 | "libz", |
| 67 | ], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 68 | export_include_dirs: ["."], |
| 69 | export_shared_lib_headers: [ |
David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 70 | "libartbase", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 71 | "libbase", |
| 72 | ], |
| 73 | } |
| 74 | |
| 75 | gensrcs { |
| 76 | name: "dexfile_operator_srcs", |
Alex Light | b69d2d3 | 2018-02-21 13:37:17 -0800 | [diff] [blame] | 77 | cmd: "$(location generate_operator_out) art/libdexfile $(in) > $(out)", |
| 78 | tools: ["generate_operator_out"], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 79 | srcs: [ |
| 80 | "dex/dex_file.h", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 81 | "dex/dex_file_layout.h", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 82 | "dex/dex_instruction.h", |
| 83 | "dex/dex_instruction_utils.h", |
| 84 | "dex/invoke_type.h", |
David Sehr | 312f3b2 | 2018-03-19 08:39:26 -0700 | [diff] [blame] | 85 | "dex/method_reference.h", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 86 | ], |
| 87 | output_extension: "operator_out.cc", |
| 88 | } |
| 89 | |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 90 | art_cc_library { |
| 91 | name: "libdexfile", |
| 92 | defaults: ["libdexfile_defaults"], |
| 93 | // Leave the symbols in the shared library so that stack unwinders can |
| 94 | // produce meaningful name resolution. |
| 95 | strip: { |
| 96 | keep_symbols: true, |
| 97 | }, |
| 98 | } |
| 99 | |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 100 | art_cc_library { |
| 101 | name: "libdexfiled", |
| 102 | defaults: [ |
| 103 | "art_debug_defaults", |
| 104 | "libdexfile_defaults", |
| 105 | ], |
| 106 | } |
| 107 | |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 108 | art_cc_test { |
| 109 | name: "art_libdexfile_tests", |
| 110 | defaults: [ |
| 111 | "art_gtest_defaults", |
| 112 | ], |
| 113 | srcs: [ |
David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 114 | "dex/art_dex_file_loader_test.cc", |
Mathieu Chartier | 0d896bd | 2018-05-25 00:20:27 -0700 | [diff] [blame^] | 115 | "dex/class_accessor_test.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 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 | 312f3b2 | 2018-03-19 08:39:26 -0700 | [diff] [blame] | 120 | "dex/test_dex_file_builder_test.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 121 | "dex/dex_file_loader_test.cc", |
| 122 | "dex/dex_file_verifier_test.cc", |
| 123 | "dex/dex_instruction_test.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 124 | "dex/primitive_test.cc", |
David Sehr | 312f3b2 | 2018-03-19 08:39:26 -0700 | [diff] [blame] | 125 | "dex/string_reference_test.cc", |
David Sehr | 9c4a015 | 2018-04-05 12:23:54 -0700 | [diff] [blame] | 126 | "dex/type_lookup_table_test.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 127 | "dex/utf_test.cc", |
| 128 | ], |
| 129 | shared_libs: [ |
| 130 | "libbacktrace", |
| 131 | "libziparchive", |
| 132 | ], |
| 133 | include_dirs: [ |
| 134 | "external/zlib", |
| 135 | ], |
| 136 | } |