blob: f668f18e5b1f8e7a9efc44020d939544bc39f238 [file] [log] [blame]
Dan Willemseneee8e7f2016-06-06 22:31:58 -07001//
2// Copyright (C) 2008 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17// some files must not be compiled when building against Mingw
18// they correspond to features not used by our host development tools
19// which are also hard or even impossible to port to native Win32
20libcutils_nonwindows_sources = [
Mark Salyzyn52bd37e2016-11-07 09:39:30 -080021 "android_get_control_file.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070022 "fs.c",
23 "multiuser.c",
24 "socket_inaddr_any_server_unix.c",
25 "socket_local_client_unix.c",
26 "socket_local_server_unix.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070027 "socket_loopback_server_unix.c",
28 "socket_network_client_unix.c",
29 "sockets_unix.cpp",
30 "str_parms.c",
31]
32
Vijay Venkatraman651f8382017-01-25 18:52:17 +000033cc_library_headers {
34 name: "libcutils_vndk_headers",
35 host_supported: true,
36 export_include_dirs: ["include_vndk"],
37}
38
39cc_library_headers {
40 name: "libcutils_headers",
41 host_supported: true,
42 export_include_dirs: ["include"],
43 target: {
Dan Willemsene0cd1e02017-03-15 15:23:36 -070044 linux_bionic: {
45 enabled: true,
46 },
47 windows: {
48 enabled: true,
49 },
Vijay Venkatraman651f8382017-01-25 18:52:17 +000050 },
51}
52
Dan Willemseneee8e7f2016-06-06 22:31:58 -070053cc_library {
54 name: "libcutils",
55 host_supported: true,
56 srcs: [
57 "config_utils.c",
58 "fs_config.c",
59 "canned_fs_config.c",
60 "hashmap.c",
61 "iosched_policy.c",
62 "load_file.c",
63 "native_handle.c",
64 "open_memstream.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070065 "record_stream.c",
Isaac Chen795267d2017-02-16 11:47:33 +080066 "sched_policy.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070067 "sockets.cpp",
68 "strdup16to8.c",
69 "strdup8to16.c",
70 "strlcpy.c",
71 "threads.c",
72 ],
73
74 target: {
75 host: {
76 srcs: ["dlmalloc_stubs.c"],
77 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070078 linux_bionic: {
79 enabled: true,
80 exclude_srcs: ["dlmalloc_stubs.c"],
81 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -070082 not_windows: {
83 srcs: libcutils_nonwindows_sources + [
84 "ashmem-host.c",
85 "trace-host.c",
86 ],
87 },
88 windows: {
89 srcs: [
90 "socket_inaddr_any_server_windows.c",
91 "socket_network_client_windows.c",
92 "sockets_windows.cpp",
93 ],
94
95 enabled: true,
96 shared: {
97 enabled: false,
98 },
99 },
100
101 android: {
102 srcs: libcutils_nonwindows_sources + [
103 "android_reboot.c",
104 "ashmem-dev.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700105 "klog.cpp",
106 "partition_utils.c",
Elliott Hughes4eacd702017-01-26 17:31:40 -0800107 "properties.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700108 "qtaguid.c",
109 "trace-dev.c",
110 "uevent.c",
111 ],
Evgenii Stepanov54c78862017-01-31 16:33:53 -0800112 sanitize: {
113 misc_undefined: ["integer"],
114 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700115 },
116
117 android_arm: {
118 srcs: ["arch-arm/memset32.S"],
119 },
120 android_arm64: {
121 srcs: ["arch-arm64/android_memset.S"],
122 },
123
124 android_mips: {
125 srcs: ["arch-mips/android_memset.c"],
126 },
127 android_mips64: {
128 srcs: ["arch-mips/android_memset.c"],
129 },
130
131 android_x86: {
132 srcs: [
133 "arch-x86/android_memset16.S",
134 "arch-x86/android_memset32.S",
135 ],
136 },
137
138 android_x86_64: {
139 srcs: [
140 "arch-x86_64/android_memset16.S",
141 "arch-x86_64/android_memset32.S",
142 ],
143 },
144 },
145
146 shared_libs: ["liblog"],
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000147 header_libs: ["libcutils_headers"],
148 export_header_lib_headers: ["libcutils_headers"],
149
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700150 cflags: [
151 "-Werror",
152 "-Wall",
153 "-Wextra",
154 ],
155
156 clang: true,
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700157}
158
159subdirs = ["tests"]