blob: 39f8aba8ef4e31b9e9a234109a1685f9c89628bd [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
33cc_library {
34 name: "libcutils",
35 host_supported: true,
36 srcs: [
37 "config_utils.c",
38 "fs_config.c",
39 "canned_fs_config.c",
40 "hashmap.c",
41 "iosched_policy.c",
42 "load_file.c",
43 "native_handle.c",
44 "open_memstream.c",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070045 "record_stream.c",
46 "sched_policy.c",
47 "sockets.cpp",
48 "strdup16to8.c",
49 "strdup8to16.c",
50 "strlcpy.c",
51 "threads.c",
52 ],
53
54 target: {
55 host: {
56 srcs: ["dlmalloc_stubs.c"],
57 },
58 not_windows: {
59 srcs: libcutils_nonwindows_sources + [
60 "ashmem-host.c",
61 "trace-host.c",
62 ],
63 },
64 windows: {
65 srcs: [
66 "socket_inaddr_any_server_windows.c",
67 "socket_network_client_windows.c",
68 "sockets_windows.cpp",
69 ],
70
71 enabled: true,
72 shared: {
73 enabled: false,
74 },
75 },
76
77 android: {
78 srcs: libcutils_nonwindows_sources + [
79 "android_reboot.c",
80 "ashmem-dev.c",
81 "debugger.c",
82 "klog.cpp",
83 "partition_utils.c",
84 "properties.c",
85 "qtaguid.c",
86 "trace-dev.c",
87 "uevent.c",
88 ],
89
Dan Willemseneee8e7f2016-06-06 22:31:58 -070090 static_libs: ["libdebuggerd_client"],
91 export_static_lib_headers: ["libdebuggerd_client"],
Dan Willemseneee8e7f2016-06-06 22:31:58 -070092 },
93
94 android_arm: {
95 srcs: ["arch-arm/memset32.S"],
96 },
97 android_arm64: {
98 srcs: ["arch-arm64/android_memset.S"],
99 },
100
101 android_mips: {
102 srcs: ["arch-mips/android_memset.c"],
103 },
104 android_mips64: {
105 srcs: ["arch-mips/android_memset.c"],
106 },
107
108 android_x86: {
109 srcs: [
110 "arch-x86/android_memset16.S",
111 "arch-x86/android_memset32.S",
112 ],
113 },
114
115 android_x86_64: {
116 srcs: [
117 "arch-x86_64/android_memset16.S",
118 "arch-x86_64/android_memset32.S",
119 ],
120 },
121 },
122
123 shared_libs: ["liblog"],
124 product_variables: {
125 cpusets: {
126 cflags: ["-DUSE_CPUSETS"],
127 },
128 schedboost: {
129 cflags: ["-DUSE_SCHEDBOOST"],
130 },
131 },
132 cflags: [
133 "-Werror",
134 "-Wall",
135 "-Wextra",
136 ],
137
138 clang: true,
139 sanitize: {
140 misc_undefined: ["integer"],
141 },
142}
143
144subdirs = ["tests"]