blob: 7d293efa71a2734e9dd7a95f58b8c20277ab4e2f [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,
Dan Willemsen2e1591b2016-07-12 17:20:18 -070047 host_supported: true,
48
49 srcs: [
50 "CallStack.cpp",
51 "FileMap.cpp",
52 "JenkinsHash.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070053 "NativeHandle.cpp",
54 "Printer.cpp",
55 "PropertyMap.cpp",
56 "RefBase.cpp",
57 "SharedBuffer.cpp",
58 "Static.cpp",
59 "StopWatch.cpp",
60 "String8.cpp",
61 "String16.cpp",
Hans Boehm7f0b2602017-03-15 11:01:03 -070062 "StrongPointer.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070063 "SystemClock.cpp",
64 "Threads.cpp",
65 "Timers.cpp",
66 "Tokenizer.cpp",
67 "Unicode.cpp",
68 "VectorImpl.cpp",
69 "misc.cpp",
70 ],
71
72 cflags: ["-Werror"],
73 include_dirs: ["external/safe-iop/include"],
Steven Morelandb084bc32017-04-12 18:57:57 -070074 header_libs: [
Steven Morelandb084bc32017-04-12 18:57:57 -070075 "libutils_headers",
76 ],
77 export_header_lib_headers: [
Steven Morelandb084bc32017-04-12 18:57:57 -070078 "libutils_headers",
79 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070080
81 arch: {
82 mips: {
83 cflags: ["-DALIGN_DOUBLE"],
84 },
85 },
86
87 target: {
88 android: {
89 srcs: [
Dan Willemsen2e1591b2016-07-12 17:20:18 -070090 "Looper.cpp",
91 "ProcessCallStack.cpp",
92 "Trace.cpp",
93 ],
94
95 cflags: ["-fvisibility=protected"],
96
97 shared_libs: [
98 "libbacktrace",
99 "libcutils",
100 "libdl",
101 "liblog",
Jiyong Park0b3c24b2017-05-26 17:57:18 +0900102 "libvndksupport",
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700103 ],
Dan Willemsene16bdb12016-07-13 00:20:20 -0700104
105 sanitize: {
106 misc_undefined: ["integer"],
107 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700108 },
109
110 host: {
111 cflags: ["-DLIBUTILS_NATIVE=1"],
112
113 shared: {
114 enabled: false,
115 },
116 },
117
118 linux: {
119 srcs: [
120 "Looper.cpp",
121 "ProcessCallStack.cpp",
122 ],
123 },
Dan Willemsenab34b472016-11-29 13:32:55 -0800124 linux_bionic: {
125 enabled: true,
126 srcs: [
127 "Looper.cpp",
128 "ProcessCallStack.cpp",
129 ],
130 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700131
132 darwin: {
133 cflags: ["-Wno-unused-parameter"],
134 },
135
136 // Under MinGW, ctype.h doesn't need multi-byte support
137 windows: {
138 cflags: ["-DMB_CUR_MAX=1"],
139
140 enabled: true,
141 },
142 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700143}
144
145// Include subdirectory makefiles
146// ============================================================
147
148cc_test {
149 name: "SharedBufferTest",
150 host_supported: true,
Colin Cross2fedbf72016-07-12 23:43:18 -0700151 static_libs: ["libutils"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700152 shared_libs: ["liblog"],
153 srcs: ["SharedBufferTest.cpp"],
154}
155
156subdirs = ["tests"]