• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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")
15import("//third_party/wpa_supplicant/wpa_supplicant-2.9_standard/wpa.gni")
16WPA_ROOT_DIR = "//third_party/wpa_supplicant"
17
18if (is_standard_system) {
19  ohos_shared_library("libwpa_interface_service_1.2") {
20    branch_protector_ret = "pac_ret"
21    sanitize = {
22      cfi = true  # Enable/disable control flow integrity detection
23      boundary_sanitize = false  # Enable boundary san detection
24      cfi_cross_dso = true  # Cross-SO CFI Checks
25      integer_overflow = false  # Enable integer overflow detection
26      ubsan = false  # Enable some Ubsan options
27      cfi_vcall_icall_only = true
28      debug = false
29    }
30    include_dirs = [
31      "./service_common",
32      "../../client/include",
33      "$WPA_ROOT_DIR/wpa_supplicant-2.9_standard",
34      "$WPA_ROOT_DIR/wpa_supplicant-2.9_standard/src",
35      "$WPA_ROOT_DIR/wpa_supplicant-2.9_standard/src/utils",
36      "$WPA_ROOT_DIR/wpa_supplicant-2.9_standard/wpa_supplicant",
37      "$WPA_ROOT_DIR/wpa_supplicant-2.9_standard/wpa_supplicant_lib",
38    ]
39    sources = [
40      "service_common/hdi_wpa_common.c",
41      "service_common/hdi_wpa_hal.c",
42      "service_common/wpa_common_cmd.c",
43      "service_common/wpa_common_cmd_ext.c",
44      "service_common/wpa_hdi_util.c",
45      "service_common/wpa_p2p_cmd.c",
46      "service_common/wpa_p2p_hal.c",
47      "service_common/wpa_supplicant_hal.c",
48      "wpa_interface_service.c",
49    ]
50
51    deps = [ "../../client:wpa_hdi_client" ]
52
53    defines = [ "__OHOS__USER__" ]
54
55    cflags = [
56      "-Wall",
57      "-Wextra",
58      "-Werror",
59      "-fsigned-char",
60      "-fno-common",
61      "-fno-strict-aliasing",
62      "-DCONFIG_CTRL_IFACE",
63      "-DCONFIG_P2P",
64      "-DCONFIG_WEP",
65      "-DCONFIG_WPS",
66    ]
67    cflags += [
68      "-fdata-sections",
69      "-ffunction-sections",
70      "-Os",
71      "-fno-merge-all-constants",
72    ]
73    ldflags = [
74      "-Wl,--exclude-libs=ALL",
75      "-Wl,--gc-sections",
76    ]
77    external_deps = [
78      "c_utils:utils",
79      "drivers_interface_wlan:libwpa_stub_1.2",
80      "hdf_core:libhdf_host",
81      "hdf_core:libhdf_utils",
82      "hilog:libhilog",
83      "wpa_supplicant:wpa",
84      "wpa_supplicant:wpa_client_vendor",
85    ]
86
87    install_images = [ chipset_base_dir ]
88    subsystem_name = "hdf"
89    version_script = "libwpa_interface_service.map"
90    part_name = "drivers_peripheral_wlan"
91  }
92
93  ohos_shared_library("libwpa_hdi_c_device") {
94    branch_protector_ret = "pac_ret"
95    sanitize = {
96      cfi = true  # Enable/disable control flow integrity detection
97      boundary_sanitize = false  # Enable boundary san detection
98      cfi_cross_dso = true  # Cross-SO CFI Checks
99      integer_overflow = false  # Enable integer overflow detection
100      ubsan = false  # Enable some Ubsan options
101      cfi_vcall_icall_only = true
102      debug = false
103    }
104    include_dirs = [ "./service_common" ]
105
106    sources = [ "wpa_interface_drivers.c" ]
107
108    deps = [ ":libwpa_interface_service_1.2" ]
109
110    cflags = [
111      "-Wall",
112      "-Wextra",
113      "-Werror",
114      "-fsigned-char",
115      "-fno-common",
116      "-fno-strict-aliasing",
117    ]
118    cflags += [
119      "-fdata-sections",
120      "-ffunction-sections",
121      "-Os",
122      "-fno-merge-all-constants",
123    ]
124    ldflags = [
125      "-Wl,--exclude-libs=ALL",
126      "-Wl,--gc-sections",
127    ]
128    external_deps = [
129      "c_utils:utils",
130      "drivers_interface_wlan:libwpa_stub_1.2",
131      "hdf_core:libhdf_host",
132      "hdf_core:libhdf_ipc_adapter",
133      "hdf_core:libhdf_utils",
134      "hdf_core:libhdi",
135      "hilog:libhilog",
136    ]
137
138    shlib_type = "hdi"
139    install_images = [ chipset_base_dir ]
140    subsystem_name = "hdf"
141    part_name = "drivers_peripheral_wlan"
142  }
143
144  ohos_shared_library("hdi_wpa_base_mini") {
145    branch_protector_ret = "pac_ret"
146    sanitize = {
147      cfi = true  # Enable/disable control flow integrity detection
148      boundary_sanitize = true  # Enable boundary san detection
149      cfi_cross_dso = true  # Cross-SO CFI Checks
150      integer_overflow = true  # Enable integer overflow detection
151      ubsan = true  # Enable some Ubsan options
152      debug = false
153    }
154    include_dirs = [
155      "./service_common",
156      "../../client/include",
157    ]
158    sources = [
159      "service_common/hdi_wpa_common.c",
160      "service_common/hdi_wpa_hal.c",
161      "service_common/wpa_hdi_util.c",
162      "service_common/wpa_supplicant_hal.c",
163    ]
164
165    defines = [
166      "__OHOS__USER__",
167      "OHOS_EUPDATER",
168    ]
169
170    cflags = [
171      "-Wall",
172      "-Wextra",
173      "-Werror",
174      "-fsigned-char",
175      "-fno-common",
176      "-fno-strict-aliasing",
177      "-DCONFIG_CTRL_IFACE",
178      "-DCONFIG_P2P",
179      "-DCONFIG_WEP",
180      "-DCONFIG_WPS",
181    ]
182
183    external_deps = [
184      "c_utils:utils",
185      "drivers_interface_wlan:libwpa_stub_1.2",
186      "hdf_core:libhdf_host",
187      "hdf_core:libhdf_utils",
188      "hilog:libhilog",
189      "wpa_supplicant:wpa_client_updater",
190    ]
191
192    install_images = [ updater_vendor_base_dir ]
193    subsystem_name = "hdf"
194    part_name = "drivers_peripheral_wlan"
195  }
196} else {
197  ohos_shared_library("libwpa_interface_service_1.2") {
198    branch_protector_ret = "pac_ret"
199    sanitize = {
200      cfi = true  # Enable/disable control flow integrity detection
201      boundary_sanitize = true  # Enable boundary san detection
202      cfi_cross_dso = true  # Cross-SO CFI Checks
203      integer_overflow = true  # Enable integer overflow detection
204      ubsan = true  # Enable some Ubsan options
205      debug = false
206    }
207    include_dirs = []
208    sources = []
209
210    install_images = [ chipset_base_dir ]
211    subsystem_name = "hdf"
212    part_name = "drivers_peripheral_wlan"
213  }
214
215  ohos_shared_library("libwpa_hdi_c_device") {
216    branch_protector_ret = "pac_ret"
217    sanitize = {
218      cfi = true  # Enable/disable control flow integrity detection
219      boundary_sanitize = true  # Enable boundary san detection
220      cfi_cross_dso = true  # Cross-SO CFI Checks
221      integer_overflow = true  # Enable integer overflow detection
222      ubsan = true  # Enable some Ubsan options
223      debug = false
224    }
225    include_dirs = []
226    sources = []
227
228    install_images = [ chipset_base_dir ]
229    subsystem_name = "hdf"
230    part_name = "drivers_peripheral_wlan"
231  }
232}
233
234group("hdi_wpa_service") {
235  deps = [
236    ":libwpa_hdi_c_device",
237    ":libwpa_interface_service_1.2",
238  ]
239  if (is_standard_system) {
240    deps += [ ":hdi_wpa_base_mini" ]
241  }
242}
243