1# Copyright (c) 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15 16if (is_standard_system) { 17 ohos_shared_library("libwpa_interface_service_2.0") { 18 branch_protector_ret = "pac_ret" 19 sanitize = { 20 cfi = true # Enable/disable control flow integrity detection 21 boundary_sanitize = false # Enable boundary san detection 22 cfi_cross_dso = true # Cross-SO CFI Checks 23 integer_overflow = false # Enable integer overflow detection 24 ubsan = false # Enable some Ubsan options 25 cfi_vcall_icall_only = true 26 debug = false 27 } 28 include_dirs = [ 29 "./service_common", 30 "../../client/include", 31 ] 32 sources = [ 33 "service_common/hdi_wpa_common.c", 34 "service_common/hdi_wpa_hal.c", 35 "service_common/wpa_common_cmd.c", 36 "service_common/wpa_common_cmd_ext.c", 37 "service_common/wpa_hdi_util.c", 38 "service_common/wpa_p2p_cmd.c", 39 "service_common/wpa_p2p_hal.c", 40 "service_common/wpa_supplicant_hal.c", 41 "wpa_interface_service.c", 42 ] 43 44 deps = [ "../../client:wpa_hdi_client" ] 45 46 defines = [ "__OHOS__USER__" ] 47 48 cflags = [ 49 "-Wall", 50 "-Wextra", 51 "-Werror", 52 "-fsigned-char", 53 "-fno-common", 54 "-fno-strict-aliasing", 55 "-DCONFIG_CTRL_IFACE", 56 "-DCONFIG_P2P", 57 "-DCONFIG_WEP", 58 "-DCONFIG_WPS", 59 ] 60 cflags += [ 61 "-fdata-sections", 62 "-ffunction-sections", 63 "-Os", 64 "-fno-merge-all-constants", 65 ] 66 ldflags = [ 67 "-Wl,--exclude-libs=ALL", 68 "-Wl,--gc-sections", 69 ] 70 external_deps = [ 71 "c_utils:utils", 72 "drivers_interface_wlan:libwpa_stub_2.0", 73 "hdf_core:libhdf_ipc_adapter", 74 "hdf_core:libhdf_host", 75 "hdf_core:libhdf_utils", 76 "hilog:libhilog", 77 "wpa_supplicant:wpa", 78 "wpa_supplicant:wpa_client_vendor", 79 ] 80 81 install_images = [ 82 chipset_base_dir, 83 updater_vendor_base_dir 84 ] 85 subsystem_name = "hdf" 86 version_script = "libwpa_interface_service.map" 87 part_name = "drivers_peripheral_wlan" 88 } 89 90 ohos_shared_library("libwpa_hdi_c_device") { 91 branch_protector_ret = "pac_ret" 92 sanitize = { 93 cfi = true # Enable/disable control flow integrity detection 94 boundary_sanitize = false # Enable boundary san detection 95 cfi_cross_dso = true # Cross-SO CFI Checks 96 integer_overflow = false # Enable integer overflow detection 97 ubsan = false # Enable some Ubsan options 98 cfi_vcall_icall_only = true 99 debug = false 100 } 101 include_dirs = [ "./service_common" ] 102 103 sources = [ "wpa_interface_drivers.c" ] 104 105 deps = [ ":libwpa_interface_service_2.0" ] 106 107 cflags = [ 108 "-Wall", 109 "-Wextra", 110 "-Werror", 111 "-fsigned-char", 112 "-fno-common", 113 "-fno-strict-aliasing", 114 ] 115 cflags += [ 116 "-fdata-sections", 117 "-ffunction-sections", 118 "-Os", 119 "-fno-merge-all-constants", 120 ] 121 ldflags = [ 122 "-Wl,--exclude-libs=ALL", 123 "-Wl,--gc-sections", 124 ] 125 external_deps = [ 126 "c_utils:utils", 127 "drivers_interface_wlan:libwpa_stub_2.0", 128 "hdf_core:libhdf_host", 129 "hdf_core:libhdf_ipc_adapter", 130 "hdf_core:libhdf_utils", 131 "hdf_core:libhdi", 132 "hilog:libhilog", 133 ] 134 135 shlib_type = "hdi" 136 install_images = [ chipset_base_dir ] 137 subsystem_name = "hdf" 138 part_name = "drivers_peripheral_wlan" 139 } 140} else { 141 ohos_shared_library("libwpa_interface_service_2.0") { 142 branch_protector_ret = "pac_ret" 143 sanitize = { 144 cfi = true # Enable/disable control flow integrity detection 145 boundary_sanitize = true # Enable boundary san detection 146 cfi_cross_dso = true # Cross-SO CFI Checks 147 integer_overflow = true # Enable integer overflow detection 148 ubsan = true # Enable some Ubsan options 149 debug = false 150 } 151 include_dirs = [] 152 sources = [] 153 154 install_images = [ chipset_base_dir ] 155 subsystem_name = "hdf" 156 part_name = "drivers_peripheral_wlan" 157 } 158 159 ohos_shared_library("libwpa_hdi_c_device") { 160 branch_protector_ret = "pac_ret" 161 sanitize = { 162 cfi = true # Enable/disable control flow integrity detection 163 boundary_sanitize = true # Enable boundary san detection 164 cfi_cross_dso = true # Cross-SO CFI Checks 165 integer_overflow = true # Enable integer overflow detection 166 ubsan = true # Enable some Ubsan options 167 debug = false 168 } 169 include_dirs = [] 170 sources = [] 171 172 install_images = [ chipset_base_dir ] 173 subsystem_name = "hdf" 174 part_name = "drivers_peripheral_wlan" 175 } 176} 177 178group("hdi_wpa_service") { 179 deps = [ 180 ":libwpa_hdi_c_device", 181 ":libwpa_interface_service_2.0", 182 ] 183} 184