blob: bbfa9d8570d827e9b833bf3180cc608b718335d2 [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",
Steven Moreland91527ed2017-04-11 12:43:16 -070017 vendor_available: true,
Jiyong Park612210c2018-04-27 21:48:43 +090018 recovery_available: true,
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080019 host_supported: true,
Steven Morelandd3b4b2c2017-04-13 21:01:40 -070020
Jaesoo Lee1e8ac0f2017-04-20 16:56:45 +090021 header_libs: [
Steven Moreland95d7cbb2017-07-10 16:40:36 -070022 "liblog_headers",
Jaesoo Lee1e8ac0f2017-04-20 16:56:45 +090023 "libsystem_headers",
Elliott Hughesdc699a22018-02-16 17:58:14 -080024 "libcutils_headers",
Jaesoo Lee1e8ac0f2017-04-20 16:56:45 +090025 ],
26 export_header_lib_headers: [
Steven Moreland95d7cbb2017-07-10 16:40:36 -070027 "liblog_headers",
Jaesoo Lee1e8ac0f2017-04-20 16:56:45 +090028 "libsystem_headers",
Elliott Hughesdc699a22018-02-16 17:58:14 -080029 "libcutils_headers",
Jaesoo Lee1e8ac0f2017-04-20 16:56:45 +090030 ],
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080031 export_include_dirs: ["include"],
Steven Morelandd3b4b2c2017-04-13 21:01:40 -070032
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080033 target: {
Steven Morelandd3b4b2c2017-04-13 21:01:40 -070034 android: {
35 header_libs: ["libbacktrace_headers"],
36 export_header_lib_headers: ["libbacktrace_headers"],
37 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070038 linux_bionic: {
39 enabled: true,
40 },
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080041 windows: {
Dan Willemsene0cd1e02017-03-15 15:23:36 -070042 enabled: true,
43 },
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080044 },
45}
46
David Sehrabfb9f32018-01-17 17:07:09 -080047cc_defaults {
48 name: "libutils_defaults",
Steven Moreland91527ed2017-04-11 12:43:16 -070049 vendor_available: true,
Jiyong Park011ee122018-05-29 16:41:30 +090050 recovery_available: true,
Justin Yun9ca92452017-07-31 15:41:10 +090051 vndk: {
52 enabled: true,
53 support_system_process: true,
54 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070055 host_supported: true,
56
Elliott Hughesdc699a22018-02-16 17:58:14 -080057 cflags: [
58 "-Wall",
59 "-Werror",
60 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070061 include_dirs: ["external/safe-iop/include"],
Steven Morelandb084bc32017-04-12 18:57:57 -070062 header_libs: [
Steven Morelandb084bc32017-04-12 18:57:57 -070063 "libutils_headers",
64 ],
65 export_header_lib_headers: [
Steven Morelandb084bc32017-04-12 18:57:57 -070066 "libutils_headers",
67 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070068
Steven Moreland1f642412017-06-26 13:52:06 -070069 shared_libs: [
70 "liblog",
71 ],
Steven Moreland1f642412017-06-26 13:52:06 -070072
Dan Willemsen2e1591b2016-07-12 17:20:18 -070073 arch: {
74 mips: {
75 cflags: ["-DALIGN_DOUBLE"],
76 },
77 },
78
79 target: {
80 android: {
Dan Willemsen2e1591b2016-07-12 17:20:18 -070081 cflags: ["-fvisibility=protected"],
82
83 shared_libs: [
Dan Willemsen2e1591b2016-07-12 17:20:18 -070084 "libcutils",
85 "libdl",
Jiyong Park0b3c24b2017-05-26 17:57:18 +090086 "libvndksupport",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070087 ],
Dan Willemsene16bdb12016-07-13 00:20:20 -070088
89 sanitize: {
90 misc_undefined: ["integer"],
91 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070092 },
93
Jiyong Park011ee122018-05-29 16:41:30 +090094 recovery: {
95 exclude_shared_libs: ["libvndksupport"],
96 },
97
Dan Willemsen2e1591b2016-07-12 17:20:18 -070098 host: {
99 cflags: ["-DLIBUTILS_NATIVE=1"],
100
101 shared: {
102 enabled: false,
103 },
104 },
105
Dan Willemsenab34b472016-11-29 13:32:55 -0800106 linux_bionic: {
107 enabled: true,
Dan Willemsenab34b472016-11-29 13:32:55 -0800108 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700109
110 darwin: {
111 cflags: ["-Wno-unused-parameter"],
112 },
113
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700114 windows: {
Dan Willemsen528f1442017-11-29 18:06:11 -0800115 cflags: [
116 // Under MinGW, ctype.h doesn't need multi-byte support
117 "-DMB_CUR_MAX=1",
118 "-Wno-unused-private-field",
119 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700120
121 enabled: true,
122 },
123 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700124}
125
David Sehrabfb9f32018-01-17 17:07:09 -0800126cc_library {
127 name: "libutils",
128 defaults: ["libutils_defaults"],
129
130 srcs: [
131 "FileMap.cpp",
132 "JenkinsHash.cpp",
133 "NativeHandle.cpp",
134 "Printer.cpp",
135 "PropertyMap.cpp",
136 "RefBase.cpp",
137 "SharedBuffer.cpp",
David Sehrabfb9f32018-01-17 17:07:09 -0800138 "StopWatch.cpp",
139 "String8.cpp",
140 "String16.cpp",
141 "StrongPointer.cpp",
142 "SystemClock.cpp",
143 "Threads.cpp",
144 "Timers.cpp",
145 "Tokenizer.cpp",
146 "Unicode.cpp",
147 "VectorImpl.cpp",
148 "misc.cpp",
149 ],
150
151 target: {
152 android: {
153 srcs: [
154 "Trace.cpp",
155 ],
156 },
157 linux: {
158 srcs: [
159 "Looper.cpp",
160 ],
161 },
162 },
163}
164
165cc_library {
166 name: "libutilscallstack",
167 defaults: ["libutils_defaults"],
168
169 srcs: [
170 "CallStack.cpp",
171 ],
172
173 arch: {
174 mips: {
175 cflags: ["-DALIGN_DOUBLE"],
176 },
177 },
178
179 target: {
180 android: {
181 shared_libs: [
182 "libutils",
183 "libbacktrace",
184 ],
185 },
186 linux: {
187 srcs: [
188 "ProcessCallStack.cpp",
189 ],
190 },
191 },
192}
193
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700194// Include subdirectory makefiles
195// ============================================================
196
197cc_test {
198 name: "SharedBufferTest",
199 host_supported: true,
Colin Cross2fedbf72016-07-12 23:43:18 -0700200 static_libs: ["libutils"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700201 shared_libs: ["liblog"],
202 srcs: ["SharedBufferTest.cpp"],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800203 cflags: [
204 "-Wall",
205 "-Werror",
206 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700207}