1// 2// Copyright (C) 2018 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 16package { 17 default_applicable_licenses: ["Android-Apache-2.0"], 18} 19 20cc_library { 21 name: "libcuttlefish_utils", 22 srcs: [ 23 "architecture.cpp", 24 "archive.cpp", 25 "base64.cpp", 26 "container.cpp", 27 "device_type.cpp", 28 "files.cpp", 29 "flag_parser.cpp", 30 "flags_validator.cpp", 31 "in_sandbox.cpp", 32 "json.cpp", 33 "network.cpp", 34 "proc_file_utils.cpp", 35 "shared_fd_flag.cpp", 36 "signals.cpp", 37 "subprocess.cpp", 38 "tcp_socket.cpp", 39 "tee_logging.cpp", 40 "unix_sockets.cpp", 41 "users.cpp", 42 ], 43 shared: { 44 shared_libs: [ 45 "libbase", 46 "libcrypto", 47 "libcuttlefish_fs", 48 "libjsoncpp", 49 ], 50 }, 51 static: { 52 static_libs: [ 53 "libbase", 54 "libcuttlefish_fs", 55 "libjsoncpp", 56 ], 57 shared_libs: [ 58 "libcrypto", // libcrypto_static is not accessible from all targets 59 ], 60 }, 61 target: { 62 darwin: { 63 enabled: true, 64 }, 65 linux: { 66 srcs: [ 67 "inotify.cpp", 68 "socket2socket_proxy.cpp", // TODO(b/285989475): Find eventfd alternative 69 "vsock_connection.cpp", 70 ], 71 }, 72 }, 73 whole_static_libs: [ 74 "libcuttlefish_utils_environment", 75 "libcuttlefish_utils_result", 76 ], 77 defaults: ["cuttlefish_host"], 78 product_available: true, 79} 80 81cc_test_host { 82 name: "libcuttlefish_utils_test", 83 srcs: [ 84 "base64_test.cpp", 85 "files_test.cpp", 86 "files_test_helper.cpp", 87 "flag_parser_test.cpp", 88 "network_test.cpp", 89 "proc_file_utils_test.cpp", 90 "result_test.cpp", 91 "unix_sockets_test.cpp", 92 ], 93 static_libs: [ 94 "libbase", 95 "libcuttlefish_fs", 96 "libcuttlefish_utils", 97 "libgmock", 98 ], 99 shared_libs: [ 100 "libcrypto", 101 "liblog", 102 "libxml2", 103 ], 104 test_options: { 105 unit_test: true, 106 }, 107 defaults: ["cuttlefish_host"], 108} 109 110cc_library { 111 name: "libvsock_utils", 112 srcs: ["vsock_connection.cpp"], 113 shared_libs: [ 114 "libbase", 115 "libcuttlefish_fs", 116 "libjsoncpp", 117 "liblog", 118 ], 119 defaults: ["cuttlefish_guest_only"], 120 include_dirs: ["device/google/cuttlefish"], 121 export_include_dirs: ["."], 122} 123 124cc_library { 125 name: "libcuttlefish_utils_environment", 126 srcs: [ 127 "environment.cpp", 128 "known_paths.cpp", 129 ], 130 defaults: ["cuttlefish_host"], 131 product_available: true, 132 target: { 133 darwin: { 134 enabled: true, 135 }, 136 }, 137} 138 139cc_library { 140 name: "libcuttlefish_utils_result", 141 product_available: true, 142 srcs: ["result.cpp"], 143 static_libs: ["libbase"], 144 target: { 145 darwin: { 146 enabled: true, 147 }, 148 windows: { 149 enabled: true, 150 }, 151 }, 152 defaults: ["cuttlefish_host"], 153} 154