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