blob: bb82f4da35ec14bdba0b8023037fc3fd6cb38e15 [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 {
33 name: "libcutils_vndk_headers",
34 host_supported: true,
35 export_include_dirs: ["include_vndk"],
36}
37
38cc_library_headers {
39 name: "libcutils_headers",
40 host_supported: true,
41 export_include_dirs: ["include"],
42 target: {
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",
54 host_supported: true,
55 srcs: [
56 "config_utils.c",
57 "fs_config.c",
58 "canned_fs_config.c",
59 "hashmap.c",
60 "iosched_policy.c",
61 "load_file.c",
62 "native_handle.c",
63 "open_memstream.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070064 "record_stream.c",
Isaac Chen795267d2017-02-16 11:47:33 +080065 "sched_policy.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070066 "sockets.cpp",
67 "strdup16to8.c",
68 "strdup8to16.c",
69 "strlcpy.c",
70 "threads.c",
71 ],
72
73 target: {
74 host: {
75 srcs: ["dlmalloc_stubs.c"],
76 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070077 linux_bionic: {
78 enabled: true,
79 exclude_srcs: ["dlmalloc_stubs.c"],
80 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -070081 not_windows: {
82 srcs: libcutils_nonwindows_sources + [
83 "ashmem-host.c",
84 "trace-host.c",
85 ],
86 },
87 windows: {
88 srcs: [
89 "socket_inaddr_any_server_windows.c",
90 "socket_network_client_windows.c",
91 "sockets_windows.cpp",
92 ],
93
94 enabled: true,
95 shared: {
96 enabled: false,
97 },
98 },
99
100 android: {
101 srcs: libcutils_nonwindows_sources + [
102 "android_reboot.c",
103 "ashmem-dev.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700104 "klog.cpp",
105 "partition_utils.c",
Elliott Hughes4eacd702017-01-26 17:31:40 -0800106 "properties.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700107 "qtaguid.c",
108 "trace-dev.c",
109 "uevent.c",
110 ],
Evgenii Stepanov54c78862017-01-31 16:33:53 -0800111 sanitize: {
112 misc_undefined: ["integer"],
113 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700114 },
115
116 android_arm: {
117 srcs: ["arch-arm/memset32.S"],
118 },
119 android_arm64: {
120 srcs: ["arch-arm64/android_memset.S"],
121 },
122
123 android_mips: {
124 srcs: ["arch-mips/android_memset.c"],
125 },
126 android_mips64: {
127 srcs: ["arch-mips/android_memset.c"],
128 },
129
130 android_x86: {
131 srcs: [
132 "arch-x86/android_memset16.S",
133 "arch-x86/android_memset32.S",
134 ],
135 },
136
137 android_x86_64: {
138 srcs: [
139 "arch-x86_64/android_memset16.S",
140 "arch-x86_64/android_memset32.S",
141 ],
142 },
143 },
144
145 shared_libs: ["liblog"],
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000146 header_libs: ["libcutils_headers"],
147 export_header_lib_headers: ["libcutils_headers"],
148
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700149 cflags: [
150 "-Werror",
151 "-Wall",
152 "-Wextra",
153 ],
154
155 clang: true,
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700156}
157
158subdirs = ["tests"]