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 |
Ye Jiao | 2dc47ca | 2023-03-13 10:58:08 +0800 | [diff] [blame] | 29 | "wifi_skip_state_toggle_off_on_for_nan", // WIFI_SKIP_STATE_TOGGLE_OFF_ON_FOR_NAN |
Gabriel Biren | f3262f9 | 2022-07-15 23:25:39 +0000 | [diff] [blame] | 30 | ], |
| 31 | value_variables: [ |
| 32 | "hal_interface_combinations", // WIFI_HAL_INTERFACE_COMBINATIONS |
| 33 | ], |
| 34 | properties: [ |
| 35 | "cppflags", |
| 36 | ], |
| 37 | } |
| 38 | |
| 39 | wifi_hal_cc_defaults { |
| 40 | name: "android.hardware.wifi-service-cppflags-defaults", |
| 41 | soong_config_variables: { |
| 42 | hidl_feature_aware: { |
| 43 | cppflags: ["-DWIFI_HIDL_FEATURE_AWARE"], |
| 44 | }, |
| 45 | hidl_feature_dual_interface: { |
| 46 | cppflags: ["-DWIFI_HIDL_FEATURE_DUAL_INTERFACE"], |
| 47 | }, |
| 48 | hidl_feature_disable_ap: { |
| 49 | cppflags: ["-DWIFI_HIDL_FEATURE_DISABLE_AP"], |
| 50 | }, |
| 51 | hidl_feature_disable_ap_mac_randomization: { |
| 52 | cppflags: ["-DWIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION"], |
| 53 | }, |
| 54 | avoid_iface_reset_mac_change: { |
| 55 | cppflags: ["-DWIFI_AVOID_IFACE_RESET_MAC_CHANGE"], |
| 56 | }, |
Ye Jiao | 2dc47ca | 2023-03-13 10:58:08 +0800 | [diff] [blame] | 57 | wifi_skip_state_toggle_off_on_for_nan: { |
| 58 | cppflags: ["-DWIFI_SKIP_STATE_TOGGLE_OFF_ON_FOR_NAN"], |
| 59 | }, |
Gabriel Biren | f3262f9 | 2022-07-15 23:25:39 +0000 | [diff] [blame] | 60 | hal_interface_combinations: { |
| 61 | cppflags: ["-DWIFI_HAL_INTERFACE_COMBINATIONS=%s"], |
| 62 | }, |
| 63 | }, |
| 64 | } |
| 65 | |
| 66 | cc_library_static { |
| 67 | name: "android.hardware.wifi-service-lib", |
| 68 | defaults: ["android.hardware.wifi-service-cppflags-defaults"], |
| 69 | proprietary: true, |
| 70 | compile_multilib: "first", |
| 71 | cppflags: [ |
| 72 | "-Wall", |
| 73 | "-Werror", |
| 74 | "-Wextra", |
| 75 | ], |
| 76 | // Allow implicit fallthroughs in wifi_legacy_hal.cpp until they are fixed. |
| 77 | cflags: ["-Wno-error=implicit-fallthrough"], |
| 78 | srcs: [ |
| 79 | "aidl_struct_util.cpp", |
| 80 | "aidl_sync_util.cpp", |
| 81 | "ringbuffer.cpp", |
| 82 | "wifi.cpp", |
| 83 | "wifi_ap_iface.cpp", |
| 84 | "wifi_chip.cpp", |
| 85 | "wifi_feature_flags.cpp", |
| 86 | "wifi_iface_util.cpp", |
| 87 | "wifi_legacy_hal.cpp", |
| 88 | "wifi_legacy_hal_factory.cpp", |
| 89 | "wifi_legacy_hal_stubs.cpp", |
| 90 | "wifi_mode_controller.cpp", |
| 91 | "wifi_nan_iface.cpp", |
| 92 | "wifi_p2p_iface.cpp", |
| 93 | "wifi_rtt_controller.cpp", |
| 94 | "wifi_sta_iface.cpp", |
| 95 | "wifi_status_util.cpp", |
| 96 | ], |
| 97 | |
| 98 | shared_libs: [ |
| 99 | "libbase", |
| 100 | "libbinder_ndk", |
| 101 | "libcutils", |
| 102 | "liblog", |
| 103 | "libnl", |
| 104 | "libutils", |
| 105 | "libwifi-hal", |
| 106 | "libwifi-system-iface", |
| 107 | "libxml2", |
| 108 | "android.hardware.wifi-V1-ndk", |
| 109 | ], |
| 110 | |
| 111 | export_include_dirs: ["."], |
| 112 | } |
| 113 | |
| 114 | cc_binary { |
| 115 | name: "android.hardware.wifi-service", |
| 116 | vintf_fragments: ["android.hardware.wifi-service.xml"], |
| 117 | relative_install_path: "hw", |
| 118 | proprietary: true, |
| 119 | cppflags: [ |
| 120 | "-Wall", |
| 121 | "-Werror", |
| 122 | "-Wextra", |
| 123 | ], |
| 124 | srcs: ["service.cpp"], |
| 125 | shared_libs: [ |
| 126 | "libbase", |
| 127 | "libbinder_ndk", |
| 128 | "libcutils", |
| 129 | "liblog", |
| 130 | "libnl", |
| 131 | "libutils", |
| 132 | "libwifi-hal", |
| 133 | "libwifi-system-iface", |
| 134 | "libxml2", |
| 135 | "android.hardware.wifi-V1-ndk", |
| 136 | ], |
| 137 | static_libs: ["android.hardware.wifi-service-lib"], |
| 138 | init_rc: ["android.hardware.wifi-service.rc"], |
| 139 | } |
| 140 | |
| 141 | cc_binary { |
| 142 | name: "android.hardware.wifi-service-lazy", |
| 143 | vintf_fragments: ["android.hardware.wifi-service.xml"], |
| 144 | overrides: ["android.hardware.wifi-service"], |
| 145 | cflags: ["-DLAZY_SERVICE"], |
| 146 | relative_install_path: "hw", |
| 147 | proprietary: true, |
| 148 | cppflags: [ |
| 149 | "-Wall", |
| 150 | "-Werror", |
| 151 | "-Wextra", |
| 152 | ], |
| 153 | srcs: ["service.cpp"], |
| 154 | shared_libs: [ |
| 155 | "libbase", |
| 156 | "libbinder_ndk", |
| 157 | "libcutils", |
| 158 | "liblog", |
| 159 | "libnl", |
| 160 | "libutils", |
| 161 | "libwifi-hal", |
| 162 | "libwifi-system-iface", |
| 163 | "libxml2", |
| 164 | "android.hardware.wifi-V1-ndk", |
| 165 | ], |
| 166 | static_libs: ["android.hardware.wifi-service-lib"], |
| 167 | init_rc: ["android.hardware.wifi-service-lazy.rc"], |
| 168 | } |
| 169 | |
| 170 | cc_test { |
| 171 | name: "android.hardware.wifi-service-tests", |
| 172 | proprietary: true, |
| 173 | compile_multilib: "first", |
| 174 | cppflags: [ |
| 175 | "-Wall", |
| 176 | "-Werror", |
| 177 | "-Wextra", |
| 178 | ], |
| 179 | srcs: [ |
| 180 | "tests/aidl_struct_util_unit_tests.cpp", |
| 181 | "tests/main.cpp", |
| 182 | "tests/mock_interface_tool.cpp", |
| 183 | "tests/mock_wifi_feature_flags.cpp", |
| 184 | "tests/mock_wifi_iface_util.cpp", |
| 185 | "tests/mock_wifi_legacy_hal.cpp", |
| 186 | "tests/mock_wifi_mode_controller.cpp", |
| 187 | "tests/ringbuffer_unit_tests.cpp", |
| 188 | "tests/wifi_nan_iface_unit_tests.cpp", |
| 189 | "tests/wifi_chip_unit_tests.cpp", |
| 190 | "tests/wifi_iface_util_unit_tests.cpp", |
| 191 | ], |
| 192 | static_libs: [ |
| 193 | "libgmock", |
| 194 | "libgtest", |
| 195 | "android.hardware.wifi-V1-ndk", |
| 196 | "android.hardware.wifi-service-lib", |
| 197 | ], |
| 198 | shared_libs: [ |
| 199 | "libbase", |
| 200 | "libbinder_ndk", |
| 201 | "libcutils", |
| 202 | "liblog", |
| 203 | "libnl", |
| 204 | "libutils", |
| 205 | "libwifi-hal", |
| 206 | "libwifi-system-iface", |
| 207 | ], |
| 208 | } |
| 209 | |
| 210 | filegroup { |
| 211 | name: "default-android.hardware.wifi-service.rc", |
| 212 | srcs: ["android.hardware.wifi-service.rc"], |
| 213 | } |
| 214 | |
| 215 | filegroup { |
| 216 | name: "default-android.hardware.wifi-service.xml", |
| 217 | srcs: ["android.hardware.wifi-service.xml"], |
| 218 | } |