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") 15 16HAL_ROOT_DIR = "./.." 17 18if (defined(ohos_lite)) { 19 ohos_shared_library("wifi_hal") { 20 sources = [ 21 "src/wifi_hal.c", 22 "src/wifi_hal_ap_feature.c", 23 "src/wifi_hal_base_feature.c", 24 "src/wifi_hal_cmd.c", 25 "src/wifi_hal_sta_feature.c", 26 "src/wifi_hal_util.c", 27 ] 28 29 include_dirs = [ 30 "include", 31 "$HAL_ROOT_DIR/interfaces/include", 32 "$HAL_ROOT_DIR/client/include", 33 "//third_party/bounds_checking_function/include", 34 ] 35 36 deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 37 external_deps = [ 38 "hdf_core:hdf_posix_osal", 39 "hdf_core:libhdf_utils", 40 ] 41 defines = [ "__USER__" ] 42 43 cflags = [ 44 "-Wall", 45 "-Wextra", 46 "-Werror", 47 "-fsigned-char", 48 "-fno-common", 49 "-fno-strict-aliasing", 50 "-Wno-format", 51 "-Wno-format-extra-args", 52 ] 53 subsystem_name = "hdf" 54 part_name = "drivers_peripheral_wlan" 55 } 56} else { 57 ohos_shared_library("wifi_hal") { 58 branch_protector_ret = "pac_ret" 59 sanitize = { 60 cfi = true # Enable/disable control flow integrity detection 61 boundary_sanitize = false # Enable boundary san detection 62 cfi_cross_dso = true # Cross-SO CFI Checks 63 integer_overflow = false # Enable integer overflow detection 64 ubsan = false # Enable some Ubsan options 65 cfi_vcall_icall_only = true 66 debug = false 67 } 68 sources = [ 69 "src/wifi_hal.c", 70 "src/wifi_hal_ap_feature.c", 71 "src/wifi_hal_base_feature.c", 72 "src/wifi_hal_cmd.c", 73 "src/wifi_hal_p2p_feature.c", 74 "src/wifi_hal_sta_feature.c", 75 "src/wifi_hal_util.c", 76 ] 77 include_dirs = [ 78 "include", 79 "$HAL_ROOT_DIR/interfaces/include", 80 "$HAL_ROOT_DIR/client/include", 81 ] 82 deps = [ "$HAL_ROOT_DIR/client:wifi_driver_client" ] 83 defines = [ "__OHOS__USER__" ] 84 cflags = [ 85 "-Wall", 86 "-Wextra", 87 "-Werror", 88 "-fsigned-char", 89 "-fno-common", 90 "-fno-strict-aliasing", 91 ] 92 cflags += [ 93 "-fdata-sections", 94 "-ffunction-sections", 95 "-Os", 96 "-fno-merge-all-constants", 97 ] 98 ldflags = [ 99 "-Wl,--exclude-libs=ALL", 100 "-Wl,--gc-sections", 101 ] 102 install_images = [ chipset_base_dir ] 103 subsystem_name = "hdf" 104 part_name = "drivers_peripheral_wlan" 105 if (is_standard_system) { 106 external_deps = [ 107 "c_utils:utils", 108 "hdf_core:libhdf_utils", 109 "hilog:libhilog", 110 ] 111 } else { 112 external_deps = [ "hilog:libhilog" ] 113 } 114 } 115} 116