blob: f6c0f0e016b748be401e72ff864acb3beb4453a6 [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: {
44 windows: {
45 enabled: true,
46 },
47 },
48}
49
Dan Willemseneee8e7f2016-06-06 22:31:58 -070050cc_library {
51 name: "libcutils",
52 host_supported: true,
53 srcs: [
54 "config_utils.c",
55 "fs_config.c",
56 "canned_fs_config.c",
57 "hashmap.c",
58 "iosched_policy.c",
59 "load_file.c",
60 "native_handle.c",
61 "open_memstream.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070062 "record_stream.c",
63 "sched_policy.c",
64 "sockets.cpp",
65 "strdup16to8.c",
66 "strdup8to16.c",
67 "strlcpy.c",
68 "threads.c",
69 ],
70
Vijay Venkatraman651f8382017-01-25 18:52:17 +000071
Dan Willemseneee8e7f2016-06-06 22:31:58 -070072 target: {
73 host: {
74 srcs: ["dlmalloc_stubs.c"],
75 },
76 not_windows: {
77 srcs: libcutils_nonwindows_sources + [
78 "ashmem-host.c",
79 "trace-host.c",
80 ],
81 },
82 windows: {
83 srcs: [
84 "socket_inaddr_any_server_windows.c",
85 "socket_network_client_windows.c",
86 "sockets_windows.cpp",
87 ],
88
89 enabled: true,
90 shared: {
91 enabled: false,
92 },
93 },
94
95 android: {
96 srcs: libcutils_nonwindows_sources + [
97 "android_reboot.c",
98 "ashmem-dev.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070099 "klog.cpp",
100 "partition_utils.c",
101 "properties.c",
102 "qtaguid.c",
103 "trace-dev.c",
104 "uevent.c",
105 ],
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700106 },
107
108 android_arm: {
109 srcs: ["arch-arm/memset32.S"],
110 },
111 android_arm64: {
112 srcs: ["arch-arm64/android_memset.S"],
113 },
114
115 android_mips: {
116 srcs: ["arch-mips/android_memset.c"],
117 },
118 android_mips64: {
119 srcs: ["arch-mips/android_memset.c"],
120 },
121
122 android_x86: {
123 srcs: [
124 "arch-x86/android_memset16.S",
125 "arch-x86/android_memset32.S",
126 ],
127 },
128
129 android_x86_64: {
130 srcs: [
131 "arch-x86_64/android_memset16.S",
132 "arch-x86_64/android_memset32.S",
133 ],
134 },
135 },
136
137 shared_libs: ["liblog"],
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000138 header_libs: ["libcutils_headers"],
139 export_header_lib_headers: ["libcutils_headers"],
140
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700141 product_variables: {
142 cpusets: {
143 cflags: ["-DUSE_CPUSETS"],
144 },
145 schedboost: {
146 cflags: ["-DUSE_SCHEDBOOST"],
147 },
148 },
149 cflags: [
150 "-Werror",
151 "-Wall",
152 "-Wextra",
153 ],
154
155 clang: true,
156 sanitize: {
157 misc_undefined: ["integer"],
158 },
159}
160
161subdirs = ["tests"]