• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17cc_defaults {
18    name: "libartbase_defaults",
19    defaults: ["art_defaults"],
20    host_supported: true,
21    srcs: [
22        "base/allocator.cc",
23        "base/bit_vector.cc",
24        "base/file_magic.cc",
25        "base/hex_dump.cc",
26        "base/logging.cc",
27        "base/os_linux.cc",
28        "base/runtime_debug.cc",
29        "base/safe_copy.cc",
30        "base/scoped_flock.cc",
31        "base/time_utils.cc",
32        "base/unix_file/fd_file.cc",
33        "base/unix_file/random_access_file_utils.cc",
34        "base/utils.cc",
35    ],
36    generated_sources: ["art_libartbase_operator_srcs"],
37    cflags: ["-DBUILDING_LIBART=1"],
38    shared_libs: [
39        // For common macros.
40        "libbase",
41        "liblog",
42    ],
43    export_include_dirs: ["."],
44    // ART's macros.h depends on libbase's macros.h.
45    // Note: runtime_options.h depends on cmdline. But we don't really want to export this
46    //       generically. dex2oat takes care of it itself.
47    export_shared_lib_headers: ["libbase"],
48}
49
50gensrcs {
51    name: "art_libartbase_operator_srcs",
52    cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
53    tools: ["generate_operator_out"],
54    srcs: [
55        "base/allocator.h",
56        "base/callee_save_type.h",
57        "base/unix_file/fd_file.h",
58    ],
59    output_extension: "operator_out.cc",
60}
61
62art_cc_library {
63    name: "libartbase",
64    defaults: ["libartbase_defaults"],
65    // Leave the symbols in the shared library so that stack unwinders can
66    // produce meaningful name resolution.
67    strip: {
68        keep_symbols: true,
69    },
70    shared_libs: ["libbase"],
71    export_shared_lib_headers: ["libbase"],
72}
73
74art_cc_library {
75    name: "libartbased",
76    defaults: [
77        "art_debug_defaults",
78        "libartbase_defaults",
79    ],
80    shared_libs: ["libbase"],
81    export_shared_lib_headers: ["libbase"],
82}
83
84// For now many of these tests still use CommonRuntimeTest, almost universally because of
85// ScratchFile and related.
86// TODO: Remove CommonRuntimeTest dependency from these tests.
87art_cc_test {
88    name: "art_libartbase_tests",
89    defaults: [
90        "art_gtest_defaults",
91    ],
92    srcs: [
93        "base/bit_field_test.cc",
94        "base/bit_string_test.cc",
95        "base/bit_struct_test.cc",
96        "base/bit_utils_test.cc",
97        "base/bit_vector_test.cc",
98        "base/hash_set_test.cc",
99        "base/hex_dump_test.cc",
100        "base/histogram_test.cc",
101        "base/leb128_test.cc",
102        "base/logging_test.cc",
103        "base/safe_copy_test.cc",
104        "base/scoped_flock_test.cc",
105        "base/time_utils_test.cc",
106        "base/transform_array_ref_test.cc",
107        "base/transform_iterator_test.cc",
108        "base/unix_file/fd_file_test.cc",
109        "base/utils_test.cc",
110        "base/variant_map_test.cc",
111    ],
112    shared_libs: [
113        "libbase",
114    ],
115}
116
117cc_library_headers {
118    name: "art_libartbase_headers",
119    host_supported: true,
120    export_include_dirs: ["."],
121    shared_libs: ["libbase"],
122    export_shared_lib_headers: ["libbase"],
123}
124