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 = [ |
Mark Salyzyn | 52bd37e | 2016-11-07 09:39:30 -0800 | [diff] [blame] | 21 | "android_get_control_file.cpp", |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 22 | "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 Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 27 | "socket_network_client_unix.c", |
| 28 | "sockets_unix.cpp", |
| 29 | "str_parms.c", |
| 30 | ] |
| 31 | |
Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 32 | cc_library_headers { |
Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 33 | name: "libcutils_headers", |
Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 34 | vendor_available: true, |
Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 35 | host_supported: true, |
| 36 | export_include_dirs: ["include"], |
| 37 | target: { |
Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 38 | vendor: { |
| 39 | export_include_dirs: ["include_vndk"], |
| 40 | }, |
Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 41 | linux_bionic: { |
| 42 | enabled: true, |
| 43 | }, |
| 44 | windows: { |
| 45 | enabled: true, |
| 46 | }, |
Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 47 | }, |
| 48 | } |
| 49 | |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 50 | cc_library { |
| 51 | name: "libcutils", |
Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 52 | vendor_available: true, |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 53 | host_supported: true, |
| 54 | srcs: [ |
| 55 | "config_utils.c", |
Mark Salyzyn | 163ecc6 | 2017-05-02 08:56:15 -0700 | [diff] [blame] | 56 | "fs_config.cpp", |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 57 | "canned_fs_config.c", |
| 58 | "hashmap.c", |
| 59 | "iosched_policy.c", |
| 60 | "load_file.c", |
| 61 | "native_handle.c", |
| 62 | "open_memstream.c", |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 63 | "record_stream.c", |
Isaac Chen | 795267d | 2017-02-16 11:47:33 +0800 | [diff] [blame] | 64 | "sched_policy.cpp", |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 65 | "sockets.cpp", |
| 66 | "strdup16to8.c", |
| 67 | "strdup8to16.c", |
| 68 | "strlcpy.c", |
| 69 | "threads.c", |
| 70 | ], |
| 71 | |
| 72 | target: { |
| 73 | host: { |
| 74 | srcs: ["dlmalloc_stubs.c"], |
| 75 | }, |
Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 76 | linux_bionic: { |
| 77 | enabled: true, |
| 78 | exclude_srcs: ["dlmalloc_stubs.c"], |
| 79 | }, |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 80 | not_windows: { |
| 81 | srcs: libcutils_nonwindows_sources + [ |
| 82 | "ashmem-host.c", |
| 83 | "trace-host.c", |
| 84 | ], |
| 85 | }, |
| 86 | windows: { |
| 87 | srcs: [ |
| 88 | "socket_inaddr_any_server_windows.c", |
| 89 | "socket_network_client_windows.c", |
| 90 | "sockets_windows.cpp", |
| 91 | ], |
| 92 | |
| 93 | enabled: true, |
| 94 | shared: { |
| 95 | enabled: false, |
| 96 | }, |
Mark Salyzyn | 163ecc6 | 2017-05-02 08:56:15 -0700 | [diff] [blame] | 97 | cflags: [ |
| 98 | "-D_GNU_SOURCE", |
| 99 | ], |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 100 | }, |
| 101 | |
| 102 | android: { |
| 103 | srcs: libcutils_nonwindows_sources + [ |
| 104 | "android_reboot.c", |
| 105 | "ashmem-dev.c", |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 106 | "klog.cpp", |
| 107 | "partition_utils.c", |
Elliott Hughes | 4eacd70 | 2017-01-26 17:31:40 -0800 | [diff] [blame] | 108 | "properties.cpp", |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 109 | "qtaguid.c", |
| 110 | "trace-dev.c", |
| 111 | "uevent.c", |
| 112 | ], |
Evgenii Stepanov | 54c7886 | 2017-01-31 16:33:53 -0800 | [diff] [blame] | 113 | sanitize: { |
| 114 | misc_undefined: ["integer"], |
| 115 | }, |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 116 | }, |
| 117 | |
| 118 | android_arm: { |
| 119 | srcs: ["arch-arm/memset32.S"], |
| 120 | }, |
| 121 | android_arm64: { |
| 122 | srcs: ["arch-arm64/android_memset.S"], |
| 123 | }, |
| 124 | |
| 125 | android_mips: { |
| 126 | srcs: ["arch-mips/android_memset.c"], |
| 127 | }, |
| 128 | android_mips64: { |
| 129 | srcs: ["arch-mips/android_memset.c"], |
| 130 | }, |
| 131 | |
| 132 | android_x86: { |
| 133 | srcs: [ |
| 134 | "arch-x86/android_memset16.S", |
| 135 | "arch-x86/android_memset32.S", |
| 136 | ], |
| 137 | }, |
| 138 | |
| 139 | android_x86_64: { |
| 140 | srcs: [ |
| 141 | "arch-x86_64/android_memset16.S", |
| 142 | "arch-x86_64/android_memset32.S", |
| 143 | ], |
| 144 | }, |
| 145 | }, |
| 146 | |
| 147 | shared_libs: ["liblog"], |
Steven Moreland | d73be1b | 2017-04-13 23:48:57 -0700 | [diff] [blame] | 148 | header_libs: [ |
| 149 | "libcutils_headers", |
| 150 | "libutils_headers", |
| 151 | ], |
Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 152 | export_header_lib_headers: ["libcutils_headers"], |
Yifan Hong | b680712 | 2017-07-25 15:24:04 -0700 | [diff] [blame] | 153 | local_include_dirs: ["include"], |
Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 154 | |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 155 | cflags: [ |
| 156 | "-Werror", |
| 157 | "-Wall", |
| 158 | "-Wextra", |
| 159 | ], |
Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | subdirs = ["tests"] |