blob: 58170ec7171350cbb4a34bbb3fc0f5fa359d21c8 [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"],
37 target: {
Steven Moreland385fe692017-04-13 14:29:58 -070038 vendor: {
39 export_include_dirs: ["include_vndk"],
40 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070041 linux_bionic: {
42 enabled: true,
43 },
44 windows: {
45 enabled: true,
46 },
Vijay Venkatraman651f8382017-01-25 18:52:17 +000047 },
48}
49
Dan Willemseneee8e7f2016-06-06 22:31:58 -070050cc_library {
51 name: "libcutils",
Steven Moreland385fe692017-04-13 14:29:58 -070052 vendor_available: true,
Dan Willemseneee8e7f2016-06-06 22:31:58 -070053 host_supported: true,
54 srcs: [
55 "config_utils.c",
56 "fs_config.c",
57 "canned_fs_config.c",
58 "hashmap.c",
59 "iosched_policy.c",
60 "load_file.c",
61 "native_handle.c",
62 "open_memstream.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070063 "record_stream.c",
Isaac Chen795267d2017-02-16 11:47:33 +080064 "sched_policy.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070065 "sockets.cpp",
66 "strdup16to8.c",
67 "strdup8to16.c",
68 "strlcpy.c",
69 "threads.c",
70 ],
71
72 target: {
73 host: {
74 srcs: ["dlmalloc_stubs.c"],
75 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070076 linux_bionic: {
77 enabled: true,
78 exclude_srcs: ["dlmalloc_stubs.c"],
79 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -070080 not_windows: {
81 srcs: libcutils_nonwindows_sources + [
82 "ashmem-host.c",
83 "trace-host.c",
84 ],
85 },
86 windows: {
87 srcs: [
88 "socket_inaddr_any_server_windows.c",
89 "socket_network_client_windows.c",
90 "sockets_windows.cpp",
91 ],
92
93 enabled: true,
94 shared: {
95 enabled: false,
96 },
97 },
98
99 android: {
100 srcs: libcutils_nonwindows_sources + [
101 "android_reboot.c",
102 "ashmem-dev.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700103 "klog.cpp",
104 "partition_utils.c",
Elliott Hughes4eacd702017-01-26 17:31:40 -0800105 "properties.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700106 "qtaguid.c",
107 "trace-dev.c",
108 "uevent.c",
109 ],
Evgenii Stepanov54c78862017-01-31 16:33:53 -0800110 sanitize: {
111 misc_undefined: ["integer"],
112 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700113 },
114
115 android_arm: {
116 srcs: ["arch-arm/memset32.S"],
117 },
118 android_arm64: {
119 srcs: ["arch-arm64/android_memset.S"],
120 },
121
122 android_mips: {
123 srcs: ["arch-mips/android_memset.c"],
124 },
125 android_mips64: {
126 srcs: ["arch-mips/android_memset.c"],
127 },
128
129 android_x86: {
130 srcs: [
131 "arch-x86/android_memset16.S",
132 "arch-x86/android_memset32.S",
133 ],
134 },
135
136 android_x86_64: {
137 srcs: [
138 "arch-x86_64/android_memset16.S",
139 "arch-x86_64/android_memset32.S",
140 ],
141 },
142 },
143
144 shared_libs: ["liblog"],
Steven Morelandd73be1b2017-04-13 23:48:57 -0700145 header_libs: [
146 "libcutils_headers",
147 "libutils_headers",
148 ],
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000149 export_header_lib_headers: ["libcutils_headers"],
150
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700151 cflags: [
152 "-Werror",
153 "-Wall",
154 "-Wextra",
155 ],
156
157 clang: true,
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700158}
159
160subdirs = ["tests"]