blob: 3bca6c82f6799008cdbd28329c11f838b4fd5720 [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,
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080018 host_supported: true,
Steven Morelandd3b4b2c2017-04-13 21:01:40 -070019
Jaesoo Lee1e8ac0f2017-04-20 16:56:45 +090020 header_libs: [
Steven Moreland95d7cbb2017-07-10 16:40:36 -070021 "liblog_headers",
Jaesoo Lee1e8ac0f2017-04-20 16:56:45 +090022 "libsystem_headers",
23 "libcutils_headers"
24 ],
25 export_header_lib_headers: [
Steven Moreland95d7cbb2017-07-10 16:40:36 -070026 "liblog_headers",
Jaesoo Lee1e8ac0f2017-04-20 16:56:45 +090027 "libsystem_headers",
28 "libcutils_headers"
29 ],
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080030 export_include_dirs: ["include"],
Steven Morelandd3b4b2c2017-04-13 21:01:40 -070031
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080032 target: {
Steven Morelandd3b4b2c2017-04-13 21:01:40 -070033 android: {
34 header_libs: ["libbacktrace_headers"],
35 export_header_lib_headers: ["libbacktrace_headers"],
36 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070037 linux_bionic: {
38 enabled: true,
39 },
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080040 windows: {
Dan Willemsene0cd1e02017-03-15 15:23:36 -070041 enabled: true,
42 },
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080043 },
44}
45
David Sehrabfb9f32018-01-17 17:07:09 -080046cc_defaults {
47 name: "libutils_defaults",
Steven Moreland91527ed2017-04-11 12:43:16 -070048 vendor_available: true,
Justin Yun9ca92452017-07-31 15:41:10 +090049 vndk: {
50 enabled: true,
51 support_system_process: true,
52 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070053 host_supported: true,
54
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -070055 cflags: ["-Wall", "-Werror"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070056 include_dirs: ["external/safe-iop/include"],
Steven Morelandb084bc32017-04-12 18:57:57 -070057 header_libs: [
Steven Morelandb084bc32017-04-12 18:57:57 -070058 "libutils_headers",
59 ],
60 export_header_lib_headers: [
Steven Morelandb084bc32017-04-12 18:57:57 -070061 "libutils_headers",
62 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070063
Steven Moreland1f642412017-06-26 13:52:06 -070064 shared_libs: [
65 "liblog",
66 ],
Steven Moreland1f642412017-06-26 13:52:06 -070067
Dan Willemsen2e1591b2016-07-12 17:20:18 -070068 arch: {
69 mips: {
70 cflags: ["-DALIGN_DOUBLE"],
71 },
72 },
73
74 target: {
75 android: {
Dan Willemsen2e1591b2016-07-12 17:20:18 -070076 cflags: ["-fvisibility=protected"],
77
78 shared_libs: [
Dan Willemsen2e1591b2016-07-12 17:20:18 -070079 "libcutils",
80 "libdl",
Jiyong Park0b3c24b2017-05-26 17:57:18 +090081 "libvndksupport",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070082 ],
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
Dan Willemsenab34b472016-11-29 13:32:55 -080097 linux_bionic: {
98 enabled: true,
Dan Willemsenab34b472016-11-29 13:32:55 -080099 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700100
101 darwin: {
102 cflags: ["-Wno-unused-parameter"],
103 },
104
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700105 windows: {
Dan Willemsen528f1442017-11-29 18:06:11 -0800106 cflags: [
107 // Under MinGW, ctype.h doesn't need multi-byte support
108 "-DMB_CUR_MAX=1",
109 "-Wno-unused-private-field",
110 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700111
112 enabled: true,
113 },
114 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700115}
116
David Sehrabfb9f32018-01-17 17:07:09 -0800117cc_library {
118 name: "libutils",
119 defaults: ["libutils_defaults"],
120
121 srcs: [
122 "FileMap.cpp",
123 "JenkinsHash.cpp",
124 "NativeHandle.cpp",
125 "Printer.cpp",
126 "PropertyMap.cpp",
127 "RefBase.cpp",
128 "SharedBuffer.cpp",
129 "Static.cpp",
130 "StopWatch.cpp",
131 "String8.cpp",
132 "String16.cpp",
133 "StrongPointer.cpp",
134 "SystemClock.cpp",
135 "Threads.cpp",
136 "Timers.cpp",
137 "Tokenizer.cpp",
138 "Unicode.cpp",
139 "VectorImpl.cpp",
140 "misc.cpp",
141 ],
142
143 target: {
144 android: {
145 srcs: [
146 "Trace.cpp",
147 ],
148 },
149 linux: {
150 srcs: [
151 "Looper.cpp",
152 ],
153 },
154 },
155}
156
157cc_library {
158 name: "libutilscallstack",
159 defaults: ["libutils_defaults"],
160
161 srcs: [
162 "CallStack.cpp",
163 ],
164
165 arch: {
166 mips: {
167 cflags: ["-DALIGN_DOUBLE"],
168 },
169 },
170
171 target: {
172 android: {
173 shared_libs: [
174 "libutils",
175 "libbacktrace",
176 ],
177 },
178 linux: {
179 srcs: [
180 "ProcessCallStack.cpp",
181 ],
182 },
183 },
184}
185
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700186// Include subdirectory makefiles
187// ============================================================
188
189cc_test {
190 name: "SharedBufferTest",
191 host_supported: true,
Colin Cross2fedbf72016-07-12 23:43:18 -0700192 static_libs: ["libutils"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700193 shared_libs: ["liblog"],
194 srcs: ["SharedBufferTest.cpp"],
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -0700195 cflags: ["-Wall", "-Werror"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700196}
197
198subdirs = ["tests"]