• 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")
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 = false  # Enable boundary san detection
54      cfi_cross_dso = true  # Cross-SO CFI Checks
55      integer_overflow = false  # Enable integer overflow detection
56      ubsan = false  # Enable some Ubsan options
57      cfi_vcall_icall_only = true
58      debug = false
59    }
60    include_dirs = [ "include" ]
61    sources = [ "src/wpa_client.c" ]
62    public_configs = [ ":wpa_hdi_client_public_config" ]
63
64    external_deps = [
65      "c_utils:utils",
66      "hdf_core:libhdf_utils",
67      "hilog:libhilog",
68    ]
69    defines = [ "__OHOS__USER__" ]
70
71    cflags = [
72      "-Wall",
73      "-Wextra",
74      "-Werror",
75      "-fsigned-char",
76      "-fno-common",
77      "-fno-strict-aliasing",
78    ]
79    cflags += [
80      "-fdata-sections",
81      "-ffunction-sections",
82      "-Os",
83      "-fno-merge-all-constants",
84    ]
85    ldflags = [
86      "-Wl,--exclude-libs=ALL",
87      "-Wl,--gc-sections",
88    ]
89    install_images = [
90      chipset_base_dir,
91      updater_vendor_base_dir,
92    ]
93    subsystem_name = "hdf"
94    part_name = "drivers_peripheral_wlan"
95  }
96}
97