blob: 9e7cc138c3df86f9756530ff94710b1f5ebfc111 [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 Moreland42b485c2017-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 Moreland42b485c2017-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
Dan Willemsen2e1591b2016-07-12 17:20:18 -070046cc_library {
47 name: "libutils",
Steven Moreland91527ed2017-04-11 12:43:16 -070048 vendor_available: true,
Dan Willemsen2e1591b2016-07-12 17:20:18 -070049 host_supported: true,
50
51 srcs: [
52 "CallStack.cpp",
53 "FileMap.cpp",
54 "JenkinsHash.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070055 "NativeHandle.cpp",
56 "Printer.cpp",
57 "PropertyMap.cpp",
58 "RefBase.cpp",
59 "SharedBuffer.cpp",
60 "Static.cpp",
61 "StopWatch.cpp",
62 "String8.cpp",
63 "String16.cpp",
Hans Boehm7f0b2602017-03-15 11:01:03 -070064 "StrongPointer.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070065 "SystemClock.cpp",
66 "Threads.cpp",
67 "Timers.cpp",
68 "Tokenizer.cpp",
69 "Unicode.cpp",
70 "VectorImpl.cpp",
71 "misc.cpp",
72 ],
73
74 cflags: ["-Werror"],
75 include_dirs: ["external/safe-iop/include"],
Steven Morelandb084bc32017-04-12 18:57:57 -070076 header_libs: [
Steven Morelandb084bc32017-04-12 18:57:57 -070077 "libutils_headers",
78 ],
79 export_header_lib_headers: [
Steven Morelandb084bc32017-04-12 18:57:57 -070080 "libutils_headers",
81 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070082
Steven Moreland43e20ca2017-06-26 13:52:06 -070083 shared_libs: [
84 "liblog",
85 ],
Steven Moreland43e20ca2017-06-26 13:52:06 -070086
Dan Willemsen2e1591b2016-07-12 17:20:18 -070087 arch: {
88 mips: {
89 cflags: ["-DALIGN_DOUBLE"],
90 },
91 },
92
93 target: {
94 android: {
95 srcs: [
Dan Willemsen2e1591b2016-07-12 17:20:18 -070096 "Looper.cpp",
97 "ProcessCallStack.cpp",
98 "Trace.cpp",
99 ],
100
101 cflags: ["-fvisibility=protected"],
102
103 shared_libs: [
104 "libbacktrace",
105 "libcutils",
106 "libdl",
Jiyong Park0b3c24b2017-05-26 17:57:18 +0900107 "libvndksupport",
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700108 ],
Dan Willemsene16bdb12016-07-13 00:20:20 -0700109
110 sanitize: {
111 misc_undefined: ["integer"],
112 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700113 },
114
115 host: {
116 cflags: ["-DLIBUTILS_NATIVE=1"],
117
118 shared: {
119 enabled: false,
120 },
121 },
122
123 linux: {
124 srcs: [
125 "Looper.cpp",
126 "ProcessCallStack.cpp",
127 ],
128 },
Dan Willemsenab34b472016-11-29 13:32:55 -0800129 linux_bionic: {
130 enabled: true,
131 srcs: [
132 "Looper.cpp",
133 "ProcessCallStack.cpp",
134 ],
135 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700136
137 darwin: {
138 cflags: ["-Wno-unused-parameter"],
139 },
140
141 // Under MinGW, ctype.h doesn't need multi-byte support
142 windows: {
143 cflags: ["-DMB_CUR_MAX=1"],
144
145 enabled: true,
146 },
147 },
148
149 clang: true,
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700150}
151
152// Include subdirectory makefiles
153// ============================================================
154
155cc_test {
156 name: "SharedBufferTest",
157 host_supported: true,
Colin Cross2fedbf72016-07-12 23:43:18 -0700158 static_libs: ["libutils"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700159 shared_libs: ["liblog"],
160 srcs: ["SharedBufferTest.cpp"],
161}
162
163subdirs = ["tests"]