blob: b772b78050732ebc6c0d982f0882dea7033d662e [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: {
Dan Willemsene0cd1e02017-03-15 15:23:36 -070020 linux_bionic: {
21 enabled: true,
22 },
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080023 windows: {
Dan Willemsene0cd1e02017-03-15 15:23:36 -070024 enabled: true,
25 },
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080026 },
27}
28
Dan Willemsen2e1591b2016-07-12 17:20:18 -070029cc_library {
30 name: "libutils",
31 host_supported: true,
32
33 srcs: [
34 "CallStack.cpp",
35 "FileMap.cpp",
36 "JenkinsHash.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070037 "Log.cpp",
38 "NativeHandle.cpp",
39 "Printer.cpp",
40 "PropertyMap.cpp",
41 "RefBase.cpp",
42 "SharedBuffer.cpp",
43 "Static.cpp",
44 "StopWatch.cpp",
45 "String8.cpp",
46 "String16.cpp",
47 "SystemClock.cpp",
48 "Threads.cpp",
49 "Timers.cpp",
50 "Tokenizer.cpp",
51 "Unicode.cpp",
52 "VectorImpl.cpp",
53 "misc.cpp",
54 ],
55
56 cflags: ["-Werror"],
57 include_dirs: ["external/safe-iop/include"],
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080058 header_libs: ["libutils_headers"],
59 export_header_lib_headers: ["libutils_headers"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070060
61 arch: {
62 mips: {
63 cflags: ["-DALIGN_DOUBLE"],
64 },
65 },
66
67 target: {
68 android: {
69 srcs: [
Dan Willemsen2e1591b2016-07-12 17:20:18 -070070 "Looper.cpp",
71 "ProcessCallStack.cpp",
72 "Trace.cpp",
73 ],
74
75 cflags: ["-fvisibility=protected"],
76
77 shared_libs: [
78 "libbacktrace",
79 "libcutils",
80 "libdl",
81 "liblog",
82 ],
Dan Willemsene16bdb12016-07-13 00:20:20 -070083
84 sanitize: {
85 misc_undefined: ["integer"],
86 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070087 },
88
89 host: {
90 cflags: ["-DLIBUTILS_NATIVE=1"],
91
92 shared: {
93 enabled: false,
94 },
95 },
96
97 linux: {
98 srcs: [
99 "Looper.cpp",
100 "ProcessCallStack.cpp",
101 ],
102 },
Dan Willemsenab34b472016-11-29 13:32:55 -0800103 linux_bionic: {
104 enabled: true,
105 srcs: [
106 "Looper.cpp",
107 "ProcessCallStack.cpp",
108 ],
109 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700110
111 darwin: {
112 cflags: ["-Wno-unused-parameter"],
113 },
114
115 // Under MinGW, ctype.h doesn't need multi-byte support
116 windows: {
117 cflags: ["-DMB_CUR_MAX=1"],
118
119 enabled: true,
120 },
121 },
122
123 clang: true,
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700124}
125
126// Include subdirectory makefiles
127// ============================================================
128
129cc_test {
130 name: "SharedBufferTest",
131 host_supported: true,
Colin Cross2fedbf72016-07-12 23:43:18 -0700132 static_libs: ["libutils"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700133 shared_libs: ["liblog"],
134 srcs: ["SharedBufferTest.cpp"],
135}
136
137subdirs = ["tests"]