Gabriel Biren | f3262f9 | 2022-07-15 23:25:39 +0000 | [diff] [blame] | 1 | // Copyright (C) 2022 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package { |
| 16 | default_applicable_licenses: ["hardware_interfaces_license"], |
| 17 | } |
| 18 | |
| 19 | soong_config_module_type { |
| 20 | name: "wifi_hal_cc_defaults", |
| 21 | module_type: "cc_defaults", |
| 22 | config_namespace: "wifi", |
| 23 | bool_variables: [ |
| 24 | "hidl_feature_aware", // WIFI_HIDL_FEATURE_AWARE |
| 25 | "hidl_feature_dual_interface", // WIFI_HIDL_FEATURE_DUAL_INTERFACE |
| 26 | "hidl_feature_disable_ap", // WIFI_HIDL_FEATURE_DISABLE_AP |
| 27 | "hidl_feature_disable_ap_mac_randomization", // WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION |
| 28 | "avoid_iface_reset_mac_change", // WIFI_AVOID_IFACE_RESET_MAC_CHANGE |
| 29 | ], |
| 30 | value_variables: [ |
| 31 | "hal_interface_combinations", // WIFI_HAL_INTERFACE_COMBINATIONS |
| 32 | ], |
| 33 | properties: [ |
| 34 | "cppflags", |
| 35 | ], |
| 36 | } |
| 37 | |
| 38 | wifi_hal_cc_defaults { |
| 39 | name: "android.hardware.wifi-service-cppflags-defaults", |
| 40 | soong_config_variables: { |
| 41 | hidl_feature_aware: { |
| 42 | cppflags: ["-DWIFI_HIDL_FEATURE_AWARE"], |
| 43 | }, |
| 44 | hidl_feature_dual_interface: { |
| 45 | cppflags: ["-DWIFI_HIDL_FEATURE_DUAL_INTERFACE"], |
| 46 | }, |
| 47 | hidl_feature_disable_ap: { |
| 48 | cppflags: ["-DWIFI_HIDL_FEATURE_DISABLE_AP"], |
| 49 | }, |
| 50 | hidl_feature_disable_ap_mac_randomization: { |
| 51 | cppflags: ["-DWIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION"], |
| 52 | }, |
| 53 | avoid_iface_reset_mac_change: { |
| 54 | cppflags: ["-DWIFI_AVOID_IFACE_RESET_MAC_CHANGE"], |
| 55 | }, |
| 56 | hal_interface_combinations: { |
| 57 | cppflags: ["-DWIFI_HAL_INTERFACE_COMBINATIONS=%s"], |
| 58 | }, |
| 59 | }, |
| 60 | } |
| 61 | |
| 62 | cc_library_static { |
| 63 | name: "android.hardware.wifi-service-lib", |
| 64 | defaults: ["android.hardware.wifi-service-cppflags-defaults"], |
| 65 | proprietary: true, |
| 66 | compile_multilib: "first", |
| 67 | cppflags: [ |
| 68 | "-Wall", |
| 69 | "-Werror", |
| 70 | "-Wextra", |
| 71 | ], |
| 72 | // Allow implicit fallthroughs in wifi_legacy_hal.cpp until they are fixed. |
| 73 | cflags: ["-Wno-error=implicit-fallthrough"], |
| 74 | srcs: [ |
| 75 | "aidl_struct_util.cpp", |
| 76 | "aidl_sync_util.cpp", |
| 77 | "ringbuffer.cpp", |
| 78 | "wifi.cpp", |
| 79 | "wifi_ap_iface.cpp", |
| 80 | "wifi_chip.cpp", |
| 81 | "wifi_feature_flags.cpp", |
| 82 | "wifi_iface_util.cpp", |
| 83 | "wifi_legacy_hal.cpp", |
| 84 | "wifi_legacy_hal_factory.cpp", |
| 85 | "wifi_legacy_hal_stubs.cpp", |
| 86 | "wifi_mode_controller.cpp", |
| 87 | "wifi_nan_iface.cpp", |
| 88 | "wifi_p2p_iface.cpp", |
| 89 | "wifi_rtt_controller.cpp", |
| 90 | "wifi_sta_iface.cpp", |
| 91 | "wifi_status_util.cpp", |
| 92 | ], |
| 93 | |
| 94 | shared_libs: [ |
| 95 | "libbase", |
| 96 | "libbinder_ndk", |
| 97 | "libcutils", |
| 98 | "liblog", |
| 99 | "libnl", |
| 100 | "libutils", |
| 101 | "libwifi-hal", |
| 102 | "libwifi-system-iface", |
| 103 | "libxml2", |
| 104 | "android.hardware.wifi-V1-ndk", |
| 105 | ], |
| 106 | |
| 107 | export_include_dirs: ["."], |
| 108 | } |
| 109 | |
| 110 | cc_binary { |
| 111 | name: "android.hardware.wifi-service", |
| 112 | vintf_fragments: ["android.hardware.wifi-service.xml"], |
| 113 | relative_install_path: "hw", |
| 114 | proprietary: true, |
| 115 | cppflags: [ |
| 116 | "-Wall", |
| 117 | "-Werror", |
| 118 | "-Wextra", |
| 119 | ], |
| 120 | srcs: ["service.cpp"], |
| 121 | shared_libs: [ |
| 122 | "libbase", |
| 123 | "libbinder_ndk", |
| 124 | "libcutils", |
| 125 | "liblog", |
| 126 | "libnl", |
| 127 | "libutils", |
| 128 | "libwifi-hal", |
| 129 | "libwifi-system-iface", |
| 130 | "libxml2", |
| 131 | "android.hardware.wifi-V1-ndk", |
| 132 | ], |
| 133 | static_libs: ["android.hardware.wifi-service-lib"], |
| 134 | init_rc: ["android.hardware.wifi-service.rc"], |
| 135 | } |
| 136 | |
| 137 | cc_binary { |
| 138 | name: "android.hardware.wifi-service-lazy", |
| 139 | vintf_fragments: ["android.hardware.wifi-service.xml"], |
| 140 | overrides: ["android.hardware.wifi-service"], |
| 141 | cflags: ["-DLAZY_SERVICE"], |
| 142 | relative_install_path: "hw", |
| 143 | proprietary: true, |
| 144 | cppflags: [ |
| 145 | "-Wall", |
| 146 | "-Werror", |
| 147 | "-Wextra", |
| 148 | ], |
| 149 | srcs: ["service.cpp"], |
| 150 | shared_libs: [ |
| 151 | "libbase", |
| 152 | "libbinder_ndk", |
| 153 | "libcutils", |
| 154 | "liblog", |
| 155 | "libnl", |
| 156 | "libutils", |
| 157 | "libwifi-hal", |
| 158 | "libwifi-system-iface", |
| 159 | "libxml2", |
| 160 | "android.hardware.wifi-V1-ndk", |
| 161 | ], |
| 162 | static_libs: ["android.hardware.wifi-service-lib"], |
| 163 | init_rc: ["android.hardware.wifi-service-lazy.rc"], |
| 164 | } |
| 165 | |
| 166 | cc_test { |
| 167 | name: "android.hardware.wifi-service-tests", |
| 168 | proprietary: true, |
| 169 | compile_multilib: "first", |
| 170 | cppflags: [ |
| 171 | "-Wall", |
| 172 | "-Werror", |
| 173 | "-Wextra", |
| 174 | ], |
| 175 | srcs: [ |
| 176 | "tests/aidl_struct_util_unit_tests.cpp", |
| 177 | "tests/main.cpp", |
| 178 | "tests/mock_interface_tool.cpp", |
| 179 | "tests/mock_wifi_feature_flags.cpp", |
| 180 | "tests/mock_wifi_iface_util.cpp", |
| 181 | "tests/mock_wifi_legacy_hal.cpp", |
| 182 | "tests/mock_wifi_mode_controller.cpp", |
| 183 | "tests/ringbuffer_unit_tests.cpp", |
| 184 | "tests/wifi_nan_iface_unit_tests.cpp", |
| 185 | "tests/wifi_chip_unit_tests.cpp", |
| 186 | "tests/wifi_iface_util_unit_tests.cpp", |
| 187 | ], |
| 188 | static_libs: [ |
| 189 | "libgmock", |
| 190 | "libgtest", |
| 191 | "android.hardware.wifi-V1-ndk", |
| 192 | "android.hardware.wifi-service-lib", |
| 193 | ], |
| 194 | shared_libs: [ |
| 195 | "libbase", |
| 196 | "libbinder_ndk", |
| 197 | "libcutils", |
| 198 | "liblog", |
| 199 | "libnl", |
| 200 | "libutils", |
| 201 | "libwifi-hal", |
| 202 | "libwifi-system-iface", |
| 203 | ], |
| 204 | } |
| 205 | |
| 206 | filegroup { |
| 207 | name: "default-android.hardware.wifi-service.rc", |
| 208 | srcs: ["android.hardware.wifi-service.rc"], |
| 209 | } |
| 210 | |
| 211 | filegroup { |
| 212 | name: "default-android.hardware.wifi-service.xml", |
| 213 | srcs: ["android.hardware.wifi-service.xml"], |
| 214 | } |