1# Copyright (c) 2021-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") 15import("../wlan.gni") 16 17config("wifi_driver_hdi_client_public_config") { 18 include_dirs = [ "include" ] 19} 20 21if (defined(ohos_lite)) { 22 ohos_shared_library("wifi_driver_client") { 23 output_extension = "z.so" 24 sources = [ "src/wifi_driver_client.c" ] 25 sources += [ 26 "src/sbuf/sbuf_cmd_adapter.c", 27 "src/sbuf/sbuf_common_adapter.c", 28 "src/sbuf/sbuf_event_adapter.c", 29 "src/sbuf/sbuf_wpa_cmd_adapter.c", 30 ] 31 32 include_dirs = [ "include" ] 33 34 deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 35 36 external_deps = [ "hdf_core:libhdf_utils" ] 37 defines = [ "__USER__" ] 38 39 cflags = [ 40 "-Wall", 41 "-Wextra", 42 "-Werror", 43 "-fsigned-char", 44 "-fno-common", 45 "-fno-strict-aliasing", 46 "-Wno-format", 47 "-Wno-format-extra-args", 48 ] 49 50 subsystem_name = "hdf" 51 part_name = "drivers_peripheral_wlan" 52 install_images = [ "system" ] 53 } 54} else { 55 CLIENT_ROOT_DIR = "./.." 56 sources = [ 57 "src/sbuf/sbuf_common_adapter.c", 58 "src/sbuf/sbuf_wpa_cmd_adapter.c", 59 "src/wifi_driver_client.c", 60 ] 61 ohos_shared_library("wifi_driver_client") { 62 branch_protector_ret = "pac_ret" 63 sanitize = { 64 cfi = true # Enable/disable control flow integrity detection 65 boundary_sanitize = false # Enable boundary san detection 66 cfi_cross_dso = true # Cross-SO CFI Checks 67 integer_overflow = false # Enable integer overflow detection 68 ubsan = false # Enable some Ubsan options 69 cfi_vcall_icall_only = true 70 debug = false 71 } 72 if (drivers_peripheral_wlan_feature_enable_HDF_NL80211) { 73 sources += [ 74 "src/sbuf/sbuf_cmd_adapter.c", 75 "src/sbuf/sbuf_event_adapter.c", 76 ] 77 78 include_dirs = [ 79 "include", 80 "$CLIENT_ROOT_DIR/interfaces/include", 81 ] 82 public_configs = [ ":wifi_driver_hdi_client_public_config" ] 83 84 external_deps = [ 85 "c_utils:utils", 86 "hdf_core:libhdf_utils", 87 "hilog:libhilog", 88 ] 89 defines = [ "__OHOS__USER__" ] 90 91 cflags = [ 92 "-Wall", 93 "-Wextra", 94 "-Werror", 95 "-fsigned-char", 96 "-fno-common", 97 "-fno-strict-aliasing", 98 ] 99 cflags += [ 100 "-fdata-sections", 101 "-ffunction-sections", 102 "-Os", 103 "-fno-merge-all-constants", 104 ] 105 ldflags = [ 106 "-Wl,--exclude-libs=ALL", 107 "-Wl,--gc-sections", 108 ] 109 version_script = "wifi_driver_client.map" 110 install_images = [ chipset_base_dir ] 111 subsystem_name = "hdf" 112 part_name = "drivers_peripheral_wlan" 113 } else { 114 sources += [ 115 "src/netlink/netlink_cmd_adapter.c", 116 "src/netlink/netlink_event_adapter.c", 117 "src/sbuf/sbuf_event_adapter.c", 118 ] 119 120 include_dirs = [ 121 "include", 122 "$CLIENT_ROOT_DIR/interfaces/include", 123 "$root_out_dir/include", 124 "$root_out_dir/lib", 125 ] 126 127 public_configs = [ ":wifi_driver_hdi_client_public_config" ] 128 deps = [ "//third_party/libnl:libnl_share" ] 129 external_deps = [ 130 "c_utils:utils", 131 "hdf_core:libhdf_host", 132 "hdf_core:libhdf_utils", 133 "hilog:libhilog", 134 "init:libbegetutil", 135 ] 136 137 defines = [ "__OHOS__USER__" ] 138 139 cflags = [ 140 "-Wall", 141 "-Wextra", 142 "-Werror", 143 "-fsigned-char", 144 "-fno-common", 145 "-fno-strict-aliasing", 146 ] 147 cflags += [ 148 "-fdata-sections", 149 "-ffunction-sections", 150 "-Os", 151 "-fno-merge-all-constants", 152 ] 153 ldflags = [ 154 "-Wl,--exclude-libs=ALL", 155 "-Wl,--gc-sections", 156 ] 157 version_script = "wifi_driver_client.map" 158 install_images = [ chipset_base_dir ] 159 subsystem_name = "hdf" 160 part_name = "drivers_peripheral_wlan" 161 } 162 } 163} 164