1# Copyright (c) 2021-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("./../../../../usbmgr.gni")
15
16config("usbnapi_private_config") {
17  include_dirs = [
18    "${usb_manager_path}/interfaces/kits/js/napi/include",
19    "${usb_manager_path}/interfaces/innerkits/native/include",
20  ]
21}
22
23ohos_shared_library("usb") {
24  sanitize = {
25    integer_overflow = true
26    ubsan = true
27    boundary_sanitize = true
28  }
29
30  sources = [
31    "${utils_path}/native/src/usb_napi_errors.cpp",
32    "src/napi_util.cpp",
33    "src/usb_info.cpp",
34    "src/usb_middle.cpp",
35  ]
36  configs = [
37    "${utils_path}:utils_config",
38    ":usbnapi_private_config",
39  ]
40  deps = [ "${usb_manager_path}/interfaces/innerkits:usbsrv_client" ]
41  external_deps = [
42    "bounds_checking_function:libsec_shared",
43    "cJSON:cjson",
44    "drivers_interface_usb:usb_idl_headers_1.1",
45    "hilog:libhilog",
46    "napi:ace_napi",
47    "node:node_header_notice",
48  ]
49
50  relative_install_dir = "module"
51
52  subsystem_name = "usb"
53  part_name = "usb_manager"
54}
55
56ohos_shared_library("usbmanager") {
57  sanitize = {
58    integer_overflow = true
59    ubsan = true
60    boundary_sanitize = true
61  }
62
63  sources = [
64    "${utils_path}/native/src/usb_napi_errors.cpp",
65    "src/napi_util.cpp",
66    "src/usb_info.cpp",
67    "src/usbmanager_middle.cpp",
68  ]
69  configs = [
70    "${utils_path}:utils_config",
71    ":usbnapi_private_config",
72  ]
73  deps = [ "${usb_manager_path}/interfaces/innerkits:usbsrv_client" ]
74  public_external_deps = [ "cJSON:cjson" ]
75  external_deps = [
76    "bounds_checking_function:libsec_shared",
77    "drivers_interface_usb:usb_idl_headers_1.1",
78    "hilog:libhilog",
79    "napi:ace_napi",
80    "node:node_header_notice",
81  ]
82
83  relative_install_dir = "module"
84
85  subsystem_name = "usb"
86  part_name = "usb_manager"
87}
88