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")
15
16config("wpa_hdi_client_public_config") {
17  include_dirs = [
18    "include",
19    "../interfaces/hdi_service/service_common",
20  ]
21}
22
23if (defined(ohos_lite)) {
24  ohos_shared_library("wpa_hdi_client") {
25    output_extension = "z.so"
26    sources = [ "src/wpa_client.c" ]
27
28    include_dirs = [ "include" ]
29
30    external_deps = [ "hdf_core:libhdf_utils" ]
31    defines = [ "__USER__" ]
32
33    cflags = [
34      "-Wall",
35      "-Wextra",
36      "-Werror",
37      "-fsigned-char",
38      "-fno-common",
39      "-fno-strict-aliasing",
40      "-Wno-format",
41      "-Wno-format-extra-args",
42    ]
43
44    subsystem_name = "hdf"
45    part_name = "drivers_peripheral_wlan"
46    install_images = [ "system" ]
47  }
48} else {
49  ohos_shared_library("wpa_hdi_client") {
50    branch_protector_ret = "pac_ret"
51    sanitize = {
52      cfi = true  # Enable/disable control flow integrity detection
53      boundary_sanitize = true  # Enable boundary san detection
54      cfi_cross_dso = true  # Cross-SO CFI Checks
55      integer_overflow = true  # Enable integer overflow detection
56      ubsan = true  # Enable some Ubsan options
57      debug = false
58    }
59    include_dirs = [ "include" ]
60    sources = [ "src/wpa_client.c" ]
61    public_configs = [ ":wpa_hdi_client_public_config" ]
62
63    external_deps = [
64      "c_utils:utils",
65      "hdf_core:libhdf_utils",
66      "hilog:libhilog",
67    ]
68    defines = [ "__OHOS__USER__" ]
69
70    cflags = [
71      "-Wall",
72      "-Wextra",
73      "-Werror",
74      "-fsigned-char",
75      "-fno-common",
76      "-fno-strict-aliasing",
77    ]
78
79    install_images = [
80      chipset_base_dir,
81      updater_vendor_base_dir,
82    ]
83    subsystem_name = "hdf"
84    part_name = "drivers_peripheral_wlan"
85  }
86}
87