• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
16
17HDI_WLAN_SERVICE_PATH =
18    rebase_path("//device/soc/${device_company}/common/hal/wlan")
19cmd = "if [ -f ${HDI_WLAN_SERVICE_PATH}/BUILD.gn ]; then echo true; else echo false; fi"
20HAVE_WLAN_DAL_SERVICE =
21    exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
22
23ohos_shared_library("libwlan_interface_service_1.0") {
24  include_dirs = [
25    "//drivers/peripheral/wlan/interfaces/include",
26    "//drivers/peripheral/wlan/client/include",
27    "//drivers/peripheral/wlan/hal/include",
28    "//drivers/peripheral/wlan/hdi_service/service_common",
29  ]
30  sources = [
31    "service_common/wlan_common_cmd.c",
32    "wlan_interface_service.c",
33  ]
34
35  deps = [
36    "//drivers/interface/wlan/v1_0:libwlan_stub_1.0",
37    "//drivers/peripheral/wlan/hal:wifi_hal",
38  ]
39
40  if (HAVE_WLAN_DAL_SERVICE) {
41    deps += [ "${HDI_WLAN_SERVICE_PATH}:service_extend" ]
42    include_dirs += [ "//device/soc/${device_company}/common/hal/wlan" ]
43  } else {
44    deps += [ "//drivers/peripheral/wlan/hdi_service/service_extend:libwlan_service_extend" ]
45    include_dirs += [ "//drivers/peripheral/wlan/hdi_service/service_extend" ]
46  }
47  defines = [ "__OHOS__USER__" ]
48
49  cflags = [
50    "-Wall",
51    "-Wextra",
52    "-Werror",
53    "-fsigned-char",
54    "-fno-common",
55    "-fno-strict-aliasing",
56  ]
57
58  if (is_standard_system) {
59    external_deps = [
60      "c_utils:utils",
61      "hdf_core:libhdf_host",
62      "hdf_core:libhdf_utils",
63      "hiviewdfx_hilog_native:libhilog",
64    ]
65  } else {
66    external_deps = [ "hilog:libhilog" ]
67  }
68
69  install_images = [ chipset_base_dir ]
70  subsystem_name = "hdf"
71  part_name = "drivers_peripheral_wlan"
72}
73
74ohos_shared_library("libwifi_hdi_c_device") {
75  include_dirs = [
76    "//drivers/peripheral/wlan/interfaces/include",
77    "//drivers/peripheral/wlan/client/include",
78    "//drivers/peripheral/wlan/hal/include",
79  ]
80
81  sources = [ "wlan_interface_drivers.c" ]
82
83  deps = [
84    "//drivers/interface/wlan/v1_0:libwlan_stub_1.0",
85    "//drivers/peripheral/wlan/hdi_service:libwlan_interface_service_1.0",
86  ]
87
88  if (HAVE_WLAN_DAL_SERVICE) {
89    deps += [ "${HDI_WLAN_SERVICE_PATH}:service_extend" ]
90    include_dirs += [ "//device/soc/${device_company}/common/hal/wlan" ]
91  } else {
92    deps += [ "//drivers/peripheral/wlan/hdi_service/service_extend:libwlan_service_extend" ]
93    include_dirs += [ "//drivers/peripheral/wlan/hdi_service/service_extend" ]
94  }
95
96  cflags = [
97    "-Wall",
98    "-Wextra",
99    "-Werror",
100    "-fsigned-char",
101    "-fno-common",
102    "-fno-strict-aliasing",
103  ]
104
105  if (is_standard_system) {
106    external_deps = [
107      "c_utils:utils",
108      "hdf_core:libhdf_host",
109      "hdf_core:libhdf_utils",
110      "hdf_core:libhdi",
111      "hiviewdfx_hilog_native:libhilog",
112    ]
113  } else {
114    external_deps = [ "hilog:libhilog" ]
115  }
116
117  install_images = [ chipset_base_dir ]
118  subsystem_name = "hdf"
119  part_name = "drivers_peripheral_wlan"
120}
121
122group("hdi_wlan_service") {
123  deps = [
124    ":libwifi_hdi_c_device",
125    ":libwlan_interface_service_1.0",
126  ]
127}
128