• 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("libhostapd_interface_service_1.0") {
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/src",
34      "$WPA_ROOT_DIR/wpa_supplicant-2.9_standard/hostapd",
35    ]
36    sources = [
37      "hostapd_interface_service.c",
38      "service_common/hdi_hostapd_hal.c",
39      "service_common/hostapd_common_cmd.c",
40    ]
41
42    deps = [ "../../client:hostapd_hdi_client" ]
43
44    defines = [ "__OHOS__USER__" ]
45
46    cflags = [
47      "-Wall",
48      "-Wextra",
49      "-Werror",
50      "-fsigned-char",
51      "-fno-common",
52      "-fno-strict-aliasing",
53      "-DCONFIG_CTRL_IFACE",
54      "-DCONFIG_WPS",
55    ]
56    cflags += [
57      "-fdata-sections",
58      "-ffunction-sections",
59      "-Os",
60      "-fno-merge-all-constants",
61    ]
62    ldflags = [
63      "-Wl,--exclude-libs=ALL",
64      "-Wl,--gc-sections",
65    ]
66    external_deps = [
67      "c_utils:utils",
68      "drivers_interface_wlan:libhostapd_stub_1.0",
69      "hdf_core:libhdf_host",
70      "hdf_core:libhdf_utils",
71      "hilog:libhilog",
72      "wpa_supplicant:wpa",
73      "wpa_supplicant:wpa_client_vendor",
74    ]
75
76    install_images = [ chipset_base_dir ]
77    subsystem_name = "hdf"
78    version_script = "libhostapd_interface_service.map"
79    part_name = "drivers_peripheral_wlan"
80  }
81
82  ohos_shared_library("libhostapd_hdi_c_device") {
83    branch_protector_ret = "pac_ret"
84    sanitize = {
85      cfi = true  # Enable/disable control flow integrity detection
86      boundary_sanitize = false  # Enable boundary san detection
87      cfi_cross_dso = true  # Cross-SO CFI Checks
88      integer_overflow = false  # Enable integer overflow detection
89      ubsan = false  # Enable some Ubsan options
90      cfi_vcall_icall_only = true
91      debug = false
92    }
93    include_dirs = [ "./service_common" ]
94
95    sources = [ "hostapd_interface_drivers.c" ]
96
97    deps = [ ":libhostapd_interface_service_1.0" ]
98
99    cflags = [
100      "-Wall",
101      "-Wextra",
102      "-Werror",
103      "-fsigned-char",
104      "-fno-common",
105      "-fno-strict-aliasing",
106    ]
107    cflags += [
108      "-fdata-sections",
109      "-ffunction-sections",
110      "-Os",
111      "-fno-merge-all-constants",
112    ]
113    ldflags = [
114      "-Wl,--exclude-libs=ALL",
115      "-Wl,--gc-sections",
116    ]
117    external_deps = [
118      "c_utils:utils",
119      "drivers_interface_wlan:libhostapd_stub_1.0",
120      "hdf_core:libhdf_host",
121      "hdf_core:libhdf_ipc_adapter",
122      "hdf_core:libhdf_utils",
123      "hdf_core:libhdi",
124      "hilog:libhilog",
125    ]
126
127    shlib_type = "hdi"
128    install_images = [ chipset_base_dir ]
129    subsystem_name = "hdf"
130    part_name = "drivers_peripheral_wlan"
131  }
132} else {
133  ohos_shared_library("libhostapd_interface_service_1.0") {
134    branch_protector_ret = "pac_ret"
135    sanitize = {
136      cfi = true  # Enable/disable control flow integrity detection
137      boundary_sanitize = true  # Enable boundary san detection
138      cfi_cross_dso = true  # Cross-SO CFI Checks
139      integer_overflow = true  # Enable integer overflow detection
140      ubsan = true  # Enable some Ubsan options
141      debug = false
142    }
143    include_dirs = []
144    sources = []
145
146    install_images = [ chipset_base_dir ]
147    subsystem_name = "hdf"
148    part_name = "drivers_peripheral_wlan"
149  }
150
151  ohos_shared_library("libhostapd_hdi_c_device") {
152    branch_protector_ret = "pac_ret"
153    sanitize = {
154      cfi = true  # Enable/disable control flow integrity detection
155      boundary_sanitize = true  # Enable boundary san detection
156      cfi_cross_dso = true  # Cross-SO CFI Checks
157      integer_overflow = true  # Enable integer overflow detection
158      ubsan = true  # Enable some Ubsan options
159      debug = false
160    }
161    include_dirs = []
162    sources = []
163
164    install_images = [ chipset_base_dir ]
165    subsystem_name = "hdf"
166    part_name = "drivers_peripheral_wlan"
167  }
168}
169
170group("hdi_hostapd_service") {
171  deps = [
172    ":libhostapd_hdi_c_device",
173    ":libhostapd_interface_service_1.0",
174  ]
175}
176