• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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("ethernet_hdi_client_public_config") {
17  include_dirs = [
18    "include",
19    "../eth_interfaces/hdi_service/service_common",
20  ]
21}
22
23if (defined(ohos_lite)) {
24  ohos_shared_library("ethernet_hdi_client") {
25    output_extension = "z.so"
26    sources = [ "src/ethernet_eap_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_ethernet"
46    install_images = [ "system" ]
47  }
48} else {
49  ohos_shared_library("ethernet_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/ethernet_eap_client.c" ]
62    public_configs = [ ":ethernet_hdi_client_public_config" ]
63
64    external_deps = [
65      "c_utils:utils",
66      "hdf_core:libhdf_utils",
67      "hilog:libhilog",
68      "drivers_interface_ethernet:libethernet_stub_1.0",
69    ]
70    defines = [ "__OHOS__USER__" ]
71
72    cflags = [
73      "-Wall",
74      "-Wextra",
75      "-Werror",
76      "-fsigned-char",
77      "-fno-common",
78      "-fno-strict-aliasing",
79    ]
80    cflags += [
81      "-fdata-sections",
82      "-ffunction-sections",
83      "-Os",
84      "-fno-merge-all-constants",
85    ]
86    ldflags = [
87      "-Wl,--exclude-libs=ALL",
88      "-Wl,--gc-sections",
89    ]
90    install_images = [
91      chipset_base_dir,
92      updater_vendor_base_dir,
93    ]
94    subsystem_name = "hdf"
95    part_name = "drivers_peripheral_ethernet"
96  }
97}
98