• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2008 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15cc_library_headers {
16    name: "libutils_headers",
17    vendor_available: true,
18    host_supported: true,
19
20    header_libs: [
21        "liblog_headers",
22        "libsystem_headers",
23        "libcutils_headers"
24    ],
25    export_header_lib_headers: [
26        "liblog_headers",
27        "libsystem_headers",
28        "libcutils_headers"
29    ],
30    export_include_dirs: ["include"],
31
32    target: {
33        android: {
34            header_libs: ["libbacktrace_headers"],
35            export_header_lib_headers: ["libbacktrace_headers"],
36        },
37        linux_bionic: {
38            enabled: true,
39        },
40        windows: {
41            enabled: true,
42        },
43    },
44}
45
46cc_library {
47    name: "libutils",
48    vendor_available: true,
49    vndk: {
50        enabled: true,
51        support_system_process: true,
52    },
53    host_supported: true,
54
55    srcs: [
56        "CallStack.cpp",
57        "FileMap.cpp",
58        "JenkinsHash.cpp",
59        "NativeHandle.cpp",
60        "Printer.cpp",
61        "PropertyMap.cpp",
62        "RefBase.cpp",
63        "SharedBuffer.cpp",
64        "Static.cpp",
65        "StopWatch.cpp",
66        "String8.cpp",
67        "String16.cpp",
68        "StrongPointer.cpp",
69        "SystemClock.cpp",
70        "Threads.cpp",
71        "Timers.cpp",
72        "Tokenizer.cpp",
73        "Unicode.cpp",
74        "VectorImpl.cpp",
75        "misc.cpp",
76    ],
77
78    cflags: ["-Werror"],
79    include_dirs: ["external/safe-iop/include"],
80    header_libs: [
81        "libutils_headers",
82    ],
83    export_header_lib_headers: [
84        "libutils_headers",
85    ],
86
87    shared_libs: [
88        "liblog",
89    ],
90
91    arch: {
92        mips: {
93            cflags: ["-DALIGN_DOUBLE"],
94        },
95    },
96
97    target: {
98        android: {
99            srcs: [
100                "Looper.cpp",
101                "ProcessCallStack.cpp",
102                "Trace.cpp",
103            ],
104
105            cflags: ["-fvisibility=protected"],
106
107            shared_libs: [
108                "libbacktrace",
109                "libcutils",
110                "libdl",
111                "libvndksupport",
112            ],
113
114            sanitize: {
115                misc_undefined: ["integer"],
116            },
117        },
118
119        host: {
120            cflags: ["-DLIBUTILS_NATIVE=1"],
121
122            shared: {
123                enabled: false,
124            },
125        },
126
127        linux: {
128            srcs: [
129                "Looper.cpp",
130                "ProcessCallStack.cpp",
131            ],
132        },
133        linux_bionic: {
134            enabled: true,
135            srcs: [
136                "Looper.cpp",
137                "ProcessCallStack.cpp",
138            ],
139        },
140
141        darwin: {
142            cflags: ["-Wno-unused-parameter"],
143        },
144
145        // Under MinGW, ctype.h doesn't need multi-byte support
146        windows: {
147            cflags: ["-DMB_CUR_MAX=1"],
148
149            enabled: true,
150        },
151    },
152
153    clang: true,
154}
155
156// Include subdirectory makefiles
157// ============================================================
158
159cc_test {
160    name: "SharedBufferTest",
161    host_supported: true,
162    static_libs: ["libutils"],
163    shared_libs: ["liblog"],
164    srcs: ["SharedBufferTest.cpp"],
165}
166
167subdirs = ["tests"]
168