# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. if (defined(ohos_lite)) { import("//build/ohos.gni") } else { import("//build/ohos.gni") WLAN_HAL_PATH = rebase_path("//vendor/${product_company}/${product_name}/hals/wlan") cmd = "if [ -f $WLAN_HAL_PATH/product.gni ]; then echo true; else echo false; fi" HAVE_WLAN_HAL_PATH = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") if (HAVE_WLAN_HAL_PATH) { import("$WLAN_HAL_PATH/product.gni") } else { enable_HDF_NL80211 = true } } if (defined(ohos_lite)) { ohos_shared_library("wifi_driver_client") { sources = [ "src/wifi_driver_client.c" ] sources += [ "src/sbuf/sbuf_cmd_adapter.c", "src/sbuf/sbuf_common_adapter.c", "src/sbuf/sbuf_event_adapter.c", "src/sbuf/sbuf_wpa_cmd_adapter.c", ] include_dirs = [ "include", "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", ] deps = [ "//third_party/bounds_checking_function:libsec_shared" ] external_deps = [ "hdf_core:libhdf_utils" ] defines = [ "__USER__" ] cflags = [ "-Wall", "-Wextra", "-Werror", "-fsigned-char", "-fno-common", "-fno-strict-aliasing", "-Wno-format", "-Wno-format-extra-args", ] subsystem_name = "hdf" part_name = "drivers_peripheral_wlan" install_images = [ "system" ] } } else { CLIENT_ROOT_DIR = "//drivers/peripheral/wlan" sources = [ "$CLIENT_ROOT_DIR/client/src/sbuf/sbuf_common_adapter.c", "$CLIENT_ROOT_DIR/client/src/sbuf/sbuf_wpa_cmd_adapter.c", "$CLIENT_ROOT_DIR/client/src/wifi_driver_client.c", ] ohos_shared_library("wifi_driver_client") { if (enable_HDF_NL80211) { sources += [ "$CLIENT_ROOT_DIR/client/src/sbuf/sbuf_cmd_adapter.c", "$CLIENT_ROOT_DIR/client/src/sbuf/sbuf_event_adapter.c", ] include_dirs = [ "$CLIENT_ROOT_DIR/client/include", "$CLIENT_ROOT_DIR/interfaces/include", ] external_deps = [ "c_utils:utils", "hdf_core:libhdf_utils", "hiviewdfx_hilog_native:libhilog", ] defines = [ "__OHOS__USER__" ] cflags = [ "-Wall", "-Wextra", "-Werror", "-fsigned-char", "-fno-common", "-fno-strict-aliasing", ] install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "drivers_peripheral_wlan" } else { sources += [ "$CLIENT_ROOT_DIR/client/src/netlink/netlink_cmd_adapter.c", "$CLIENT_ROOT_DIR/client/src/netlink/netlink_event_adapter.c", "$CLIENT_ROOT_DIR/client/src/sbuf/sbuf_event_adapter.c", ] include_dirs = [ "$CLIENT_ROOT_DIR/client/include", "$CLIENT_ROOT_DIR/interfaces/include", "//drivers/hdf_core/framework/core/shared/include", "//drivers/hdf_core/framework/include/core", "//drivers/hdf_core/framework/include/utils", "//drivers/hdf_core/framework/adapter/khdf/linux/osal/include", "//third_party/libnl/include", "$root_out_dir/include", "$root_out_dir/lib", ] deps = [ "//third_party/libnl:libnl_share" ] external_deps = [ "c_utils:utils", "hdf_core:libhdf_utils", "hiviewdfx_hilog_native:libhilog", ] defines = [ "__OHOS__USER__" ] cflags = [ "-Wall", "-Wextra", "-Werror", "-fsigned-char", "-fno-common", "-fno-strict-aliasing", ] install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "drivers_peripheral_wlan" } } }