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", |
| 26 | "socket_loopback_client_unix.c", |
| 27 | "socket_loopback_server_unix.c", |
| 28 | "socket_network_client_unix.c", |
| 29 | "sockets_unix.cpp", |
| 30 | "str_parms.c", |
| 31 | ] |
| 32 | |
| 33 | cc_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 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 | |
Dimitry Ivanov | f93d732 | 2016-10-03 22:18:49 +0000 | [diff] [blame] | 90 | // TODO: remove liblog as whole static library, once we don't have prebuilt that requires |
| 91 | // liblog symbols present in libcutils. |
| 92 | whole_static_libs: [ |
| 93 | "liblog", |
| 94 | ], |
| 95 | |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 96 | static_libs: ["libdebuggerd_client"], |
| 97 | export_static_lib_headers: ["libdebuggerd_client"], |
| 98 | |
| 99 | cflags: [ |
| 100 | "-std=gnu90", |
| 101 | ], |
| 102 | }, |
| 103 | |
| 104 | android_arm: { |
| 105 | srcs: ["arch-arm/memset32.S"], |
| 106 | }, |
| 107 | android_arm64: { |
| 108 | srcs: ["arch-arm64/android_memset.S"], |
| 109 | }, |
| 110 | |
| 111 | android_mips: { |
| 112 | srcs: ["arch-mips/android_memset.c"], |
| 113 | }, |
| 114 | android_mips64: { |
| 115 | srcs: ["arch-mips/android_memset.c"], |
| 116 | }, |
| 117 | |
| 118 | android_x86: { |
| 119 | srcs: [ |
| 120 | "arch-x86/android_memset16.S", |
| 121 | "arch-x86/android_memset32.S", |
| 122 | ], |
| 123 | }, |
| 124 | |
| 125 | android_x86_64: { |
| 126 | srcs: [ |
| 127 | "arch-x86_64/android_memset16.S", |
| 128 | "arch-x86_64/android_memset32.S", |
| 129 | ], |
| 130 | }, |
| 131 | }, |
| 132 | |
| 133 | shared_libs: ["liblog"], |
| 134 | product_variables: { |
| 135 | cpusets: { |
| 136 | cflags: ["-DUSE_CPUSETS"], |
| 137 | }, |
| 138 | schedboost: { |
| 139 | cflags: ["-DUSE_SCHEDBOOST"], |
| 140 | }, |
| 141 | }, |
| 142 | cflags: [ |
| 143 | "-Werror", |
| 144 | "-Wall", |
| 145 | "-Wextra", |
| 146 | ], |
| 147 | |
| 148 | clang: true, |
| 149 | sanitize: { |
| 150 | misc_undefined: ["integer"], |
| 151 | }, |
| 152 | } |
| 153 | |
| 154 | subdirs = ["tests"] |