Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2022 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 | package { |
| 18 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 19 | } |
| 20 | |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 21 | cc_defaults { |
| 22 | name: "remote-access-hal-defaults", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 23 | vendor: true, |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 24 | relative_install_path: "hw", |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame] | 25 | srcs: [ |
| 26 | "src/RemoteAccessImpl.cpp", |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame] | 27 | ], |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 28 | whole_static_libs: [ |
| 29 | "RemoteAccessService", |
| 30 | ], |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame] | 31 | static_libs: [ |
Yu Shan | 2a096c4 | 2023-02-15 18:16:22 -0800 | [diff] [blame^] | 32 | "BindToDeviceSocketMutatorLib", |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame] | 33 | ], |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 34 | shared_libs: [ |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 35 | "libbinder_ndk", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 36 | "libutils", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 37 | "libprotobuf-cpp-full", |
| 38 | ], |
| 39 | defaults: [ |
| 40 | "vhalclient_defaults", |
Yu Shan | 2a096c4 | 2023-02-15 18:16:22 -0800 | [diff] [blame^] | 41 | "BindToDeviceSocketMutatorDefaults", |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 42 | ], |
| 43 | cflags: [ |
Yu Shan | 2a096c4 | 2023-02-15 18:16:22 -0800 | [diff] [blame^] | 44 | // This is already included in BindToDeviceSocketMutatorDefaults but |
| 45 | // might be overridden by vhalclient_defaults. |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 46 | "-Wno-unused-parameter", |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 47 | ], |
| 48 | } |
| 49 | |
| 50 | cc_binary { |
| 51 | name: "android.hardware.automotive.remoteaccess@V1-default-service", |
| 52 | defaults: ["remote-access-hal-defaults"], |
| 53 | vintf_fragments: ["remoteaccess-default-service.xml"], |
| 54 | init_rc: ["remoteaccess-default-service.rc"], |
| 55 | cflags: [ |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 56 | "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"", |
| 57 | ], |
| 58 | } |
| 59 | |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 60 | cc_binary { |
| 61 | name: "android.hardware.automotive.remoteaccess@V1-tcu-test-service", |
| 62 | defaults: ["remote-access-hal-defaults"], |
| 63 | vintf_fragments: ["remoteaccess-default-service.xml"], |
| 64 | init_rc: ["remoteaccess-tcu-test-service.rc"], |
| 65 | cflags: [ |
| 66 | "-DGRPC_SERVICE_ADDRESS=\"10.10.10.1:50051\"", |
Yu Shan | 39b1985 | 2023-01-12 16:20:11 -0800 | [diff] [blame] | 67 | "-DGRPC_SERVICE_IFNAME=\"eth1\"", |
Yu Shan | 1532afd | 2022-11-30 14:41:30 -0800 | [diff] [blame] | 68 | ], |
| 69 | } |
| 70 | |
Yu Shan | 7a5283f | 2022-10-25 18:01:05 -0700 | [diff] [blame] | 71 | cc_library { |
| 72 | name: "RemoteAccessService", |
| 73 | vendor_available: true, |
| 74 | local_include_dirs: ["include"], |
| 75 | export_include_dirs: ["include"], |
| 76 | srcs: [ |
| 77 | "src/RemoteAccessService.cpp", |
| 78 | ], |
| 79 | whole_static_libs: [ |
| 80 | "android.hardware.automotive.remoteaccess-V1-ndk", |
| 81 | "wakeup_client_protos", |
| 82 | "libvhalclient", |
| 83 | ], |
| 84 | defaults: [ |
| 85 | "vhalclient_defaults", |
| 86 | ], |
| 87 | shared_libs: [ |
| 88 | "libbase", |
| 89 | "libbinder_ndk", |
| 90 | "libcutils", |
| 91 | "liblog", |
| 92 | "libutils", |
| 93 | "libgrpc++", |
| 94 | "libprotobuf-cpp-full", |
| 95 | ], |
| 96 | cflags: [ |
| 97 | "-Wno-unused-parameter", |
| 98 | ], |
| 99 | } |
| 100 | |
| 101 | cc_fuzz { |
| 102 | name: "android.hardware.automotive.remoteaccess@V1-default-service.aidl_fuzzer", |
| 103 | srcs: ["fuzzer/fuzzer.cpp"], |
| 104 | whole_static_libs: [ |
| 105 | "RemoteAccessService", |
| 106 | ], |
| 107 | static_libs: [ |
| 108 | "libgtest", |
| 109 | "libgmock", |
| 110 | ], |
| 111 | shared_libs: [ |
| 112 | "libbase", |
| 113 | "libbinder_ndk", |
| 114 | "liblog", |
| 115 | "libutils", |
| 116 | "libgrpc++", |
| 117 | "libprotobuf-cpp-full", |
| 118 | ], |
| 119 | defaults: [ |
| 120 | "vhalclient_defaults", |
| 121 | "service_fuzzer_defaults", |
| 122 | ], |
| 123 | cflags: [ |
| 124 | "-Wno-unused-parameter", |
| 125 | "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"", |
| 126 | ], |
| 127 | fuzz_config: { |
| 128 | cc: [ |
| 129 | "shanyu@google.com", |
| 130 | ], |
| 131 | }, |
| 132 | } |