blob: 2b7412b4cf617acb7af283b2ae9be9252c919a20 [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",
Hans Boehm7f0b2602017-03-15 11:01:03 -070048 "StrongPointer.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070049 "SystemClock.cpp",
50 "Threads.cpp",
51 "Timers.cpp",
52 "Tokenizer.cpp",
53 "Unicode.cpp",
54 "VectorImpl.cpp",
55 "misc.cpp",
56 ],
57
58 cflags: ["-Werror"],
59 include_dirs: ["external/safe-iop/include"],
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080060 header_libs: ["libutils_headers"],
61 export_header_lib_headers: ["libutils_headers"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070062
63 arch: {
64 mips: {
65 cflags: ["-DALIGN_DOUBLE"],
66 },
67 },
68
69 target: {
70 android: {
71 srcs: [
72 "BlobCache.cpp",
73 "Looper.cpp",
74 "ProcessCallStack.cpp",
75 "Trace.cpp",
76 ],
77
78 cflags: ["-fvisibility=protected"],
79
80 shared_libs: [
81 "libbacktrace",
82 "libcutils",
83 "libdl",
84 "liblog",
85 ],
Dan Willemsene16bdb12016-07-13 00:20:20 -070086
87 sanitize: {
88 misc_undefined: ["integer"],
89 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070090 },
91
92 host: {
93 cflags: ["-DLIBUTILS_NATIVE=1"],
94
95 shared: {
96 enabled: false,
97 },
98 },
99
100 linux: {
101 srcs: [
102 "Looper.cpp",
103 "ProcessCallStack.cpp",
104 ],
105 },
Dan Willemsenab34b472016-11-29 13:32:55 -0800106 linux_bionic: {
107 enabled: true,
108 srcs: [
109 "Looper.cpp",
110 "ProcessCallStack.cpp",
111 ],
112 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700113
114 darwin: {
115 cflags: ["-Wno-unused-parameter"],
116 },
117
118 // Under MinGW, ctype.h doesn't need multi-byte support
119 windows: {
120 cflags: ["-DMB_CUR_MAX=1"],
121
122 enabled: true,
123 },
124 },
125
126 clang: true,
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700127}
128
129// Include subdirectory makefiles
130// ============================================================
131
132cc_test {
133 name: "SharedBufferTest",
134 host_supported: true,
Colin Cross2fedbf72016-07-12 23:43:18 -0700135 static_libs: ["libutils"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700136 shared_libs: ["liblog"],
137 srcs: ["SharedBufferTest.cpp"],
138}
139
140subdirs = ["tests"]