• 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/config/components/hdi/hdi.gni")
15import("//build/ohos.gni")
16import("./../../usb.gni")
17
18ohos_shared_library("libusb_serial_ddk_service_1.0") {
19  sanitize = {
20    integer_overflow = true
21    ubsan = true
22    boundary_sanitize = true
23    cfi = true
24    cfi_cross_dso = true
25    debug = false
26  }
27  branch_protector_ret = "pac_ret"
28
29  sources = [ "src/usb_serial_ddk_service.cpp" ]
30
31  if (is_standard_system) {
32    sources += [ "src/usb_serial_linux_adapter.cpp" ]
33  } else if (defined(ohos_lite)) {
34    sources += [ "src/usb_serial_liteos_adapter.cpp" ]
35  }
36  include_dirs = [
37    "include/",
38    "${usb_driver_path}/ddk/host/include",
39    "${usb_driver_path}/ddk_service/common/include",
40    "${usb_driver_path}/hdf_usb/include",
41    "${usb_driver_path}/utils/include",
42  ]
43
44  deps = [
45    "${usb_driver_path}/ddk:libusb_pnp_manager",
46    "${usb_driver_path}/ddk_service/common:libusb_ddk_service_common",
47  ]
48
49  external_deps = [
50    "access_token:libaccesstoken_sdk",
51    "c_utils:utils",
52    "drivers_interface_usb:libusb_serial_ddk_proxy_1.0",
53    "hdf_core:libhdf_utils",
54    "hilog:libhilog",
55    "ipc:ipc_single",
56  ]
57
58  install_images = [ chipset_base_dir ]
59  subsystem_name = "hdf"
60  part_name = "drivers_peripheral_usb"
61}
62
63ohos_shared_library("libusb_serial_ddk_driver") {
64  sanitize = {
65    integer_overflow = true
66    ubsan = true
67    boundary_sanitize = true
68    cfi = true
69    cfi_cross_dso = true
70    debug = false
71  }
72  branch_protector_ret = "pac_ret"
73
74  sources = [ "src/usb_serial_ddk_driver.cpp" ]
75
76  if (is_standard_system) {
77    external_deps = [
78      "c_utils:utils",
79      "drivers_interface_usb:libusb_serial_ddk_stub_1.0",
80      "hdf_core:libhdf_host",
81      "hdf_core:libhdf_ipc_adapter",
82      "hdf_core:libhdf_utils",
83      "hdf_core:libhdi",
84      "hilog:libhilog",
85      "ipc:ipc_single",
86    ]
87  } else {
88    external_deps = [ "hilog:libhilog" ]
89  }
90
91  include_dirs = [
92    "include/",
93    "${usb_driver_path}/utils/include",
94  ]
95
96  shlib_type = "hdi"
97  install_images = [ chipset_base_dir ]
98  subsystem_name = "hdf"
99  part_name = "drivers_peripheral_usb"
100}
101
102group("usb_serial_ddk_target") {
103  deps = [
104    ":libusb_serial_ddk_driver",
105    ":libusb_serial_ddk_service_1.0",
106  ]
107}
108