blob: 2a392b93a9fb482acd7e6a1de418c540ae86abb6 [file] [log] [blame]
Dan Willemsen2e1591b2016-07-12 17:20:18 -07001// 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
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080015cc_library_headers {
16 name: "libutils_headers",
17 host_supported: true,
18 export_include_dirs: ["include"],
19 target: {
20 windows: {
21 enabled: true,
22 },
23 },
24}
25
Dan Willemsen2e1591b2016-07-12 17:20:18 -070026cc_library {
27 name: "libutils",
28 host_supported: true,
29
30 srcs: [
31 "CallStack.cpp",
32 "FileMap.cpp",
33 "JenkinsHash.cpp",
Ian Pedowitz6c942302017-03-14 08:09:22 +000034 "LinearTransform.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070035 "Log.cpp",
36 "NativeHandle.cpp",
37 "Printer.cpp",
38 "PropertyMap.cpp",
39 "RefBase.cpp",
40 "SharedBuffer.cpp",
41 "Static.cpp",
42 "StopWatch.cpp",
43 "String8.cpp",
44 "String16.cpp",
45 "SystemClock.cpp",
46 "Threads.cpp",
47 "Timers.cpp",
48 "Tokenizer.cpp",
49 "Unicode.cpp",
50 "VectorImpl.cpp",
51 "misc.cpp",
52 ],
53
54 cflags: ["-Werror"],
55 include_dirs: ["external/safe-iop/include"],
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080056 header_libs: ["libutils_headers"],
57 export_header_lib_headers: ["libutils_headers"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070058
59 arch: {
60 mips: {
61 cflags: ["-DALIGN_DOUBLE"],
62 },
63 },
64
65 target: {
66 android: {
67 srcs: [
Dan Willemsen2e1591b2016-07-12 17:20:18 -070068 "Looper.cpp",
69 "ProcessCallStack.cpp",
70 "Trace.cpp",
71 ],
72
73 cflags: ["-fvisibility=protected"],
74
75 shared_libs: [
76 "libbacktrace",
77 "libcutils",
78 "libdl",
79 "liblog",
80 ],
Dan Willemsene16bdb12016-07-13 00:20:20 -070081
82 sanitize: {
83 misc_undefined: ["integer"],
84 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070085 },
86
87 host: {
88 cflags: ["-DLIBUTILS_NATIVE=1"],
89
90 shared: {
91 enabled: false,
92 },
93 },
94
95 linux: {
96 srcs: [
97 "Looper.cpp",
98 "ProcessCallStack.cpp",
99 ],
100 },
Dan Willemsenab34b472016-11-29 13:32:55 -0800101 linux_bionic: {
102 enabled: true,
103 srcs: [
104 "Looper.cpp",
105 "ProcessCallStack.cpp",
106 ],
107 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700108
109 darwin: {
110 cflags: ["-Wno-unused-parameter"],
111 },
112
113 // Under MinGW, ctype.h doesn't need multi-byte support
114 windows: {
115 cflags: ["-DMB_CUR_MAX=1"],
116
117 enabled: true,
118 },
119 },
120
121 clang: true,
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700122}
123
124// Include subdirectory makefiles
125// ============================================================
126
127cc_test {
128 name: "SharedBufferTest",
129 host_supported: true,
Colin Cross2fedbf72016-07-12 23:43:18 -0700130 static_libs: ["libutils"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700131 shared_libs: ["liblog"],
132 srcs: ["SharedBufferTest.cpp"],
133}
134
135subdirs = ["tests"]