1# Copyright (c) 2021 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 14if (defined(ohos_lite)) { 15 import("//build/lite/config/component/lite_component.gni") 16} else { 17 import("//build/ohos.gni") 18} 19 20if (defined(ohos_lite)) { 21 FWK_ROOT_DIR = "//drivers/framework" 22 shared_library("wifi_hal") { 23 output_name = "wifi_hal" 24 sources = [ 25 "src/wifi_hal.c", 26 "src/wifi_hal_ap_feature.c", 27 "src/wifi_hal_base_feature.c", 28 "src/wifi_hal_cmd.c", 29 "src/wifi_hal_sta_feature.c", 30 "src/wifi_hal_util.c", 31 ] 32 33 include_dirs = [ 34 "include", 35 "//drivers/peripheral/wlan/interfaces/include", 36 "//drivers/peripheral/wlan/client/include", 37 "$FWK_ROOT_DIR/core/shared/include", 38 "$FWK_ROOT_DIR/include/core", 39 "$FWK_ROOT_DIR/include", 40 "$FWK_ROOT_DIR/include/wifi", 41 "$FWK_ROOT_DIR/include/utils", 42 "$FWK_ROOT_DIR/ability/sbuf/include", 43 "//drivers/adapter/uhdf/posix/include", 44 "//third_party/bounds_checking_function/include", 45 "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", 46 ] 47 48 deps = [ 49 "//drivers/adapter/uhdf/posix:hdf_posix_osal", 50 "//third_party/bounds_checking_function:libsec_shared", 51 ] 52 53 defines = [ "__USER__" ] 54 55 cflags = [ 56 "-Wall", 57 "-Wextra", 58 "-Werror", 59 "-fsigned-char", 60 "-fno-common", 61 "-fno-strict-aliasing", 62 "-Wno-format", 63 "-Wno-format-extra-args", 64 ] 65 } 66 67 lite_component("wifi_hal_interface") { 68 features = [ ":wifi_hal" ] 69 } 70} else { 71 HAL_ROOT_DIR = "//drivers/peripheral/wlan" 72 73 ohos_shared_library("wifi_hal") { 74 sources = [ 75 "$HAL_ROOT_DIR/hal/src/wifi_hal.c", 76 "$HAL_ROOT_DIR/hal/src/wifi_hal_ap_feature.c", 77 "$HAL_ROOT_DIR/hal/src/wifi_hal_base_feature.c", 78 "$HAL_ROOT_DIR/hal/src/wifi_hal_cmd.c", 79 "$HAL_ROOT_DIR/hal/src/wifi_hal_sta_feature.c", 80 "$HAL_ROOT_DIR/hal/src/wifi_hal_util.c", 81 ] 82 include_dirs = [ 83 "$HAL_ROOT_DIR/hal/include", 84 "$HAL_ROOT_DIR/interfaces/include", 85 "//third_party/bounds_checking_function/include", 86 "//drivers/peripheral/wlan/client/include", 87 "//base/hiviewdfx/hilog/interfaces/native/innerkits/include", 88 ] 89 deps = [ 90 "//drivers/adapter/uhdf2/osal:libhdf_utils", 91 "//drivers/peripheral/wlan/client:wifi_driver_client", 92 "//utils/native/base:utils", 93 ] 94 defines = [ "__OHOS__USER__" ] 95 cflags = [ 96 "-Wall", 97 "-Wextra", 98 "-Werror", 99 "-fsigned-char", 100 "-fno-common", 101 "-fno-strict-aliasing", 102 ] 103 subsystem_name = "hdf" 104 if (is_standard_system) { 105 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 106 } else { 107 external_deps = [ "hilog:libhilog" ] 108 } 109 } 110} 111