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