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("libhostapd_interface_service_1.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 "hostapd_interface_service.c", 34 "service_common/hdi_hostapd_hal.c", 35 "service_common/hostapd_common_cmd.c", 36 ] 37 38 deps = [ "../../client:hostapd_hdi_client" ] 39 40 defines = [ "__OHOS__USER__" ] 41 42 cflags = [ 43 "-Wall", 44 "-Wextra", 45 "-Werror", 46 "-fsigned-char", 47 "-fno-common", 48 "-fno-strict-aliasing", 49 "-DCONFIG_CTRL_IFACE", 50 "-DCONFIG_WPS", 51 ] 52 cflags += [ 53 "-fdata-sections", 54 "-ffunction-sections", 55 "-Os", 56 "-fno-merge-all-constants", 57 ] 58 ldflags = [ 59 "-Wl,--exclude-libs=ALL", 60 "-Wl,--gc-sections", 61 ] 62 external_deps = [ 63 "c_utils:utils", 64 "drivers_interface_wlan:libhostapd_stub_1.0", 65 "hdf_core:libhdf_ipc_adapter", 66 "hdf_core:libhdf_host", 67 "hdf_core:libhdf_utils", 68 "hilog:libhilog", 69 "wpa_supplicant:wpa", 70 "wpa_supplicant:wpa_client_vendor", 71 ] 72 73 install_images = [ chipset_base_dir ] 74 subsystem_name = "hdf" 75 version_script = "libhostapd_interface_service.map" 76 part_name = "drivers_peripheral_wlan" 77 } 78 79 ohos_shared_library("libhostapd_hdi_c_device") { 80 branch_protector_ret = "pac_ret" 81 sanitize = { 82 cfi = true # Enable/disable control flow integrity detection 83 boundary_sanitize = false # Enable boundary san detection 84 cfi_cross_dso = true # Cross-SO CFI Checks 85 integer_overflow = false # Enable integer overflow detection 86 ubsan = false # Enable some Ubsan options 87 cfi_vcall_icall_only = true 88 debug = false 89 } 90 include_dirs = [ "./service_common" ] 91 92 sources = [ "hostapd_interface_drivers.c" ] 93 94 deps = [ ":libhostapd_interface_service_1.0" ] 95 96 cflags = [ 97 "-Wall", 98 "-Wextra", 99 "-Werror", 100 "-fsigned-char", 101 "-fno-common", 102 "-fno-strict-aliasing", 103 ] 104 cflags += [ 105 "-fdata-sections", 106 "-ffunction-sections", 107 "-Os", 108 "-fno-merge-all-constants", 109 ] 110 ldflags = [ 111 "-Wl,--exclude-libs=ALL", 112 "-Wl,--gc-sections", 113 ] 114 external_deps = [ 115 "c_utils:utils", 116 "drivers_interface_wlan:libhostapd_stub_1.0", 117 "hdf_core:libhdf_host", 118 "hdf_core:libhdf_ipc_adapter", 119 "hdf_core:libhdf_utils", 120 "hdf_core:libhdi", 121 "hilog:libhilog", 122 ] 123 124 shlib_type = "hdi" 125 install_images = [ chipset_base_dir ] 126 subsystem_name = "hdf" 127 part_name = "drivers_peripheral_wlan" 128 } 129} else { 130 ohos_shared_library("libhostapd_interface_service_1.0") { 131 branch_protector_ret = "pac_ret" 132 sanitize = { 133 cfi = true # Enable/disable control flow integrity detection 134 boundary_sanitize = true # Enable boundary san detection 135 cfi_cross_dso = true # Cross-SO CFI Checks 136 integer_overflow = true # Enable integer overflow detection 137 ubsan = true # Enable some Ubsan options 138 debug = false 139 } 140 include_dirs = [] 141 sources = [] 142 143 install_images = [ chipset_base_dir ] 144 subsystem_name = "hdf" 145 part_name = "drivers_peripheral_wlan" 146 } 147 148 ohos_shared_library("libhostapd_hdi_c_device") { 149 branch_protector_ret = "pac_ret" 150 sanitize = { 151 cfi = true # Enable/disable control flow integrity detection 152 boundary_sanitize = true # Enable boundary san detection 153 cfi_cross_dso = true # Cross-SO CFI Checks 154 integer_overflow = true # Enable integer overflow detection 155 ubsan = true # Enable some Ubsan options 156 debug = false 157 } 158 include_dirs = [] 159 sources = [] 160 161 install_images = [ chipset_base_dir ] 162 subsystem_name = "hdf" 163 part_name = "drivers_peripheral_wlan" 164 } 165} 166 167group("hdi_hostapd_service") { 168 deps = [ 169 ":libhostapd_hdi_c_device", 170 ":libhostapd_interface_service_1.0", 171 ] 172} 173