blob: 68ce63d7c16279e72153e7b1da307e37efe170c7 [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",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070034 "Log.cpp",
35 "NativeHandle.cpp",
36 "Printer.cpp",
37 "PropertyMap.cpp",
38 "RefBase.cpp",
39 "SharedBuffer.cpp",
40 "Static.cpp",
41 "StopWatch.cpp",
42 "String8.cpp",
43 "String16.cpp",
44 "SystemClock.cpp",
45 "Threads.cpp",
46 "Timers.cpp",
47 "Tokenizer.cpp",
48 "Unicode.cpp",
49 "VectorImpl.cpp",
50 "misc.cpp",
51 ],
52
53 cflags: ["-Werror"],
54 include_dirs: ["external/safe-iop/include"],
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080055 header_libs: ["libutils_headers"],
56 export_header_lib_headers: ["libutils_headers"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070057
58 arch: {
59 mips: {
60 cflags: ["-DALIGN_DOUBLE"],
61 },
62 },
63
64 target: {
65 android: {
66 srcs: [
Dan Willemsen2e1591b2016-07-12 17:20:18 -070067 "Looper.cpp",
68 "ProcessCallStack.cpp",
69 "Trace.cpp",
70 ],
71
72 cflags: ["-fvisibility=protected"],
73
74 shared_libs: [
75 "libbacktrace",
76 "libcutils",
77 "libdl",
78 "liblog",
79 ],
Dan Willemsene16bdb12016-07-13 00:20:20 -070080
81 sanitize: {
82 misc_undefined: ["integer"],
83 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070084 },
85
86 host: {
87 cflags: ["-DLIBUTILS_NATIVE=1"],
88
89 shared: {
90 enabled: false,
91 },
92 },
93
94 linux: {
95 srcs: [
96 "Looper.cpp",
97 "ProcessCallStack.cpp",
98 ],
99 },
Dan Willemsenab34b472016-11-29 13:32:55 -0800100 linux_bionic: {
101 enabled: true,
102 srcs: [
103 "Looper.cpp",
104 "ProcessCallStack.cpp",
105 ],
106 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700107
108 darwin: {
109 cflags: ["-Wno-unused-parameter"],
110 },
111
112 // Under MinGW, ctype.h doesn't need multi-byte support
113 windows: {
114 cflags: ["-DMB_CUR_MAX=1"],
115
116 enabled: true,
117 },
118 },
119
120 clang: true,
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700121}
122
123// Include subdirectory makefiles
124// ============================================================
125
126cc_test {
127 name: "SharedBufferTest",
128 host_supported: true,
Colin Cross2fedbf72016-07-12 23:43:18 -0700129 static_libs: ["libutils"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700130 shared_libs: ["liblog"],
131 srcs: ["SharedBufferTest.cpp"],
132}
133
134subdirs = ["tests"]