Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 1 | // |
| 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 |
| 20 | libcutils_nonwindows_sources = [ |
| 21 | "fs.c", |
| 22 | "multiuser.c", |
| 23 | "socket_inaddr_any_server_unix.c", |
| 24 | "socket_local_client_unix.c", |
| 25 | "socket_local_server_unix.c", |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 26 | "socket_loopback_server_unix.c", |
| 27 | "socket_network_client_unix.c", |
| 28 | "sockets_unix.cpp", |
| 29 | "str_parms.c", |
| 30 | ] |
| 31 | |
| 32 | cc_library { |
| 33 | name: "libcutils", |
| 34 | host_supported: true, |
| 35 | srcs: [ |
| 36 | "config_utils.c", |
Mark Salyzyn | 0b034d9 | 2016-10-27 08:04:48 -0700 | [diff] [blame^] | 37 | "files.cpp", |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 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 Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 45 | "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 Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 90 | static_libs: ["libdebuggerd_client"], |
| 91 | export_static_lib_headers: ["libdebuggerd_client"], |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 92 | }, |
| 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 | |
| 144 | subdirs = ["tests"] |