blob: 540c445d06e30ae4e5b64e2b1c046168001c94eb [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: [
21 "libsystem_headers",
22 "libcutils_headers"
23 ],
24 export_header_lib_headers: [
25 "libsystem_headers",
26 "libcutils_headers"
27 ],
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080028 export_include_dirs: ["include"],
Steven Morelandd3b4b2c2017-04-13 21:01:40 -070029
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080030 target: {
Steven Morelandd3b4b2c2017-04-13 21:01:40 -070031 android: {
32 header_libs: ["libbacktrace_headers"],
33 export_header_lib_headers: ["libbacktrace_headers"],
34 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070035 linux_bionic: {
36 enabled: true,
37 },
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080038 windows: {
Dan Willemsene0cd1e02017-03-15 15:23:36 -070039 enabled: true,
40 },
Vijay Venkatraman75acc7b2017-01-05 10:39:38 -080041 },
42}
43
Dan Willemsen2e1591b2016-07-12 17:20:18 -070044cc_library {
45 name: "libutils",
Steven Moreland91527ed2017-04-11 12:43:16 -070046 vendor_available: true,
Justin Yun9ca92452017-07-31 15:41:10 +090047 vndk: {
48 enabled: true,
49 support_system_process: true,
50 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070051 host_supported: true,
52
53 srcs: [
54 "CallStack.cpp",
55 "FileMap.cpp",
56 "JenkinsHash.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070057 "NativeHandle.cpp",
58 "Printer.cpp",
59 "PropertyMap.cpp",
60 "RefBase.cpp",
61 "SharedBuffer.cpp",
62 "Static.cpp",
63 "StopWatch.cpp",
64 "String8.cpp",
65 "String16.cpp",
Hans Boehm7f0b2602017-03-15 11:01:03 -070066 "StrongPointer.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070067 "SystemClock.cpp",
68 "Threads.cpp",
69 "Timers.cpp",
70 "Tokenizer.cpp",
71 "Unicode.cpp",
72 "VectorImpl.cpp",
73 "misc.cpp",
74 ],
75
76 cflags: ["-Werror"],
77 include_dirs: ["external/safe-iop/include"],
Steven Morelandb084bc32017-04-12 18:57:57 -070078 header_libs: [
Steven Morelandb084bc32017-04-12 18:57:57 -070079 "libutils_headers",
80 ],
81 export_header_lib_headers: [
Steven Morelandb084bc32017-04-12 18:57:57 -070082 "libutils_headers",
83 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070084
Steven Moreland1f642412017-06-26 13:52:06 -070085 shared_libs: [
86 "liblog",
87 ],
88 export_shared_lib_headers: [
89 "liblog",
90 ],
91
Dan Willemsen2e1591b2016-07-12 17:20:18 -070092 arch: {
93 mips: {
94 cflags: ["-DALIGN_DOUBLE"],
95 },
96 },
97
98 target: {
99 android: {
100 srcs: [
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700101 "Looper.cpp",
102 "ProcessCallStack.cpp",
103 "Trace.cpp",
104 ],
105
106 cflags: ["-fvisibility=protected"],
107
108 shared_libs: [
109 "libbacktrace",
110 "libcutils",
111 "libdl",
Jiyong Park0b3c24b2017-05-26 17:57:18 +0900112 "libvndksupport",
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700113 ],
Dan Willemsene16bdb12016-07-13 00:20:20 -0700114
115 sanitize: {
116 misc_undefined: ["integer"],
117 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700118 },
119
120 host: {
121 cflags: ["-DLIBUTILS_NATIVE=1"],
122
123 shared: {
124 enabled: false,
125 },
126 },
127
Dan Willemsen48529332017-10-02 10:38:16 -0700128 linux_glibc: {
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700129 srcs: [
130 "Looper.cpp",
131 "ProcessCallStack.cpp",
132 ],
133 },
Dan Willemsenab34b472016-11-29 13:32:55 -0800134 linux_bionic: {
135 enabled: true,
136 srcs: [
137 "Looper.cpp",
138 "ProcessCallStack.cpp",
139 ],
140 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700141
142 darwin: {
143 cflags: ["-Wno-unused-parameter"],
144 },
145
146 // Under MinGW, ctype.h doesn't need multi-byte support
147 windows: {
148 cflags: ["-DMB_CUR_MAX=1"],
149
150 enabled: true,
151 },
152 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700153}
154
155// Include subdirectory makefiles
156// ============================================================
157
158cc_test {
159 name: "SharedBufferTest",
160 host_supported: true,
Colin Cross2fedbf72016-07-12 23:43:18 -0700161 static_libs: ["libutils"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700162 shared_libs: ["liblog"],
163 srcs: ["SharedBufferTest.cpp"],
164}
165
166subdirs = ["tests"]