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