1# Copyright (c) 2022 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.
13import("//base/print/print_fwk/print.gni")
14import("//build/ohos.gni")
15
16cflags_cc = []
17
18config("scan_interfaces_kits_napi_config") {
19  visibility = [ ":*" ]
20  include_dirs = [ "include" ]
21
22  cflags_cc += [ "-fno-exceptions" ]
23}
24ohos_shared_library("scan_helper") {
25  include_dirs = [
26    "${print_path}/frameworks/innerkitsimpl/scan_impl/include",
27    "${print_utils_path}/include",
28  ]
29  public_configs = [ ":scan_interfaces_kits_napi_config" ]
30
31  branch_protector_ret = "pac_ret"
32  sanitize = {
33    cfi = true
34    cfi_cross_dso = true
35    boundary_sanitize = true
36    debug = false
37    integer_overflow = true
38    ubsan = true
39  }
40
41  if (debug_enable) {
42    cflags_cc += [ "-DDEBUG_ENABLE" ]
43  }
44
45  sources = [
46    "src/napi_scan_utils.cpp",
47    "src/scan_option_descriptor.cpp",
48    "src/scan_option_descriptor_helper.cpp",
49    "src/scan_option_value.cpp",
50    "src/scan_option_value_helper.cpp",
51    "src/scan_parameters.cpp",
52    "src/scan_parameters_helper.cpp",
53    "src/scan_progress.cpp",
54    "src/scan_progress_helper.cpp",
55    "src/scan_range.cpp",
56    "src/scan_range_helper.cpp",
57    "src/scanner_info.cpp",
58    "src/scanner_info_helper.cpp",
59  ]
60
61  external_deps = [
62    "ability_base:want",
63    "ability_base:zuri",
64    "ability_runtime:ability_manager",
65    "ability_runtime:abilitykit_native",
66    "ability_runtime:data_ability_helper",
67    "ability_runtime:napi_base_context",
68    "c_utils:utils",
69    "common_event_service:cesfwk_innerkits",
70    "eventhandler:libeventhandler",
71    "hilog:libhilog",
72    "ipc:ipc_core",
73    "napi:ace_napi",
74    "samgr:samgr_proxy",
75  ]
76
77  if (build_variant == "user") {
78    cflags_cc += [ "-DIS_RELEASE_VERSION" ]
79  }
80
81  #relative_install_dir = "module"
82  install_enable = true
83  subsystem_name = "print"
84  innerapi_tags = [ "platformsdk" ]
85  part_name = "print_fwk"
86}
87