blob: 0ad714feea6b96897295aa0125d89258cb0a36c0 [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_network_client_unix.c",
28 "sockets_unix.cpp",
29 "str_parms.c",
30]
31
Vijay Venkatraman651f8382017-01-25 18:52:17 +000032cc_library_headers {
Vijay Venkatraman651f8382017-01-25 18:52:17 +000033 name: "libcutils_headers",
Steven Moreland385fe692017-04-13 14:29:58 -070034 vendor_available: true,
Vijay Venkatraman651f8382017-01-25 18:52:17 +000035 host_supported: true,
36 export_include_dirs: ["include"],
Jiyong Park8f63b6c2017-09-04 12:18:40 +090037 header_libs: ["liblog_headers"],
38 export_header_lib_headers: ["liblog_headers"],
Vijay Venkatraman651f8382017-01-25 18:52:17 +000039 target: {
Steven Moreland385fe692017-04-13 14:29:58 -070040 vendor: {
41 export_include_dirs: ["include_vndk"],
42 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070043 linux_bionic: {
44 enabled: true,
45 },
46 windows: {
47 enabled: true,
48 },
Vijay Venkatraman651f8382017-01-25 18:52:17 +000049 },
50}
51
Dan Willemseneee8e7f2016-06-06 22:31:58 -070052cc_library {
53 name: "libcutils",
Steven Moreland385fe692017-04-13 14:29:58 -070054 vendor_available: true,
Justin Yunaeb68e82017-07-31 15:41:10 +090055 vndk: {
56 enabled: true,
57 support_system_process: true,
58 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -070059 host_supported: true,
60 srcs: [
61 "config_utils.c",
Mark Salyzyn163ecc62017-05-02 08:56:15 -070062 "fs_config.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070063 "canned_fs_config.c",
64 "hashmap.c",
65 "iosched_policy.c",
66 "load_file.c",
67 "native_handle.c",
68 "open_memstream.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070069 "record_stream.c",
Isaac Chen795267d2017-02-16 11:47:33 +080070 "sched_policy.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070071 "sockets.cpp",
72 "strdup16to8.c",
73 "strdup8to16.c",
74 "strlcpy.c",
75 "threads.c",
76 ],
77
78 target: {
79 host: {
80 srcs: ["dlmalloc_stubs.c"],
81 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070082 linux_bionic: {
83 enabled: true,
84 exclude_srcs: ["dlmalloc_stubs.c"],
85 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -070086 not_windows: {
87 srcs: libcutils_nonwindows_sources + [
88 "ashmem-host.c",
89 "trace-host.c",
90 ],
91 },
92 windows: {
93 srcs: [
94 "socket_inaddr_any_server_windows.c",
95 "socket_network_client_windows.c",
96 "sockets_windows.cpp",
97 ],
98
99 enabled: true,
100 shared: {
101 enabled: false,
102 },
Mark Salyzyn163ecc62017-05-02 08:56:15 -0700103 cflags: [
104 "-D_GNU_SOURCE",
105 ],
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700106 },
107
108 android: {
109 srcs: libcutils_nonwindows_sources + [
110 "android_reboot.c",
111 "ashmem-dev.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700112 "klog.cpp",
113 "partition_utils.c",
Elliott Hughes4eacd702017-01-26 17:31:40 -0800114 "properties.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700115 "qtaguid.c",
116 "trace-dev.c",
117 "uevent.c",
118 ],
Evgenii Stepanov54c78862017-01-31 16:33:53 -0800119 sanitize: {
120 misc_undefined: ["integer"],
121 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700122 },
123
124 android_arm: {
125 srcs: ["arch-arm/memset32.S"],
126 },
127 android_arm64: {
128 srcs: ["arch-arm64/android_memset.S"],
129 },
130
131 android_mips: {
132 srcs: ["arch-mips/android_memset.c"],
133 },
134 android_mips64: {
135 srcs: ["arch-mips/android_memset.c"],
136 },
137
138 android_x86: {
139 srcs: [
140 "arch-x86/android_memset16.S",
141 "arch-x86/android_memset32.S",
142 ],
143 },
144
145 android_x86_64: {
146 srcs: [
147 "arch-x86_64/android_memset16.S",
148 "arch-x86_64/android_memset32.S",
149 ],
150 },
151 },
152
153 shared_libs: ["liblog"],
Steven Morelandd73be1b2017-04-13 23:48:57 -0700154 header_libs: [
155 "libcutils_headers",
156 "libutils_headers",
157 ],
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000158 export_header_lib_headers: ["libcutils_headers"],
Yifan Hong6c210962017-07-25 15:24:04 -0700159 local_include_dirs: ["include"],
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000160
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700161 cflags: [
162 "-Werror",
163 "-Wall",
164 "-Wextra",
165 ],
166
167 clang: true,
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700168}
169
170subdirs = ["tests"]