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. 13 14import("//base/print/print_fwk/print.gni") 15import("//build/ohos.gni") 16 17cflags_cc = [] 18 19config("scan_service_config") { 20 visibility = [ ":*" ] 21 include_dirs = [ 22 "include", 23 "${print_path}/frameworks/helper/scan_helper/include", 24 ] 25 26 cflags_cc += [ 27 "-fdata-sections", 28 "-ffunction-sections", 29 "-fno-asynchronous-unwind-tables", 30 "-fno-unwind-tables", 31 "-flto", 32 "-Os", 33 ] 34} 35 36_sources = [ 37 "src/sane_manager_client.cpp", 38 "src/sane_sa_death_recipient.cpp", 39 "src/sane_service_load_callback.cpp", 40 "src/scan_callback_proxy.cpp", 41 "src/scan_event_subscriber.cpp", 42 "src/scan_mdns_service.cpp", 43 "src/scan_service_ability.cpp", 44 "src/scan_service_stub.cpp", 45 "src/scan_system_data.cpp", 46 "src/scan_usb_manager.cpp", 47 "src/scan_service_utils.cpp", 48] 49 50_branch_protector_ret = "pac_ret" 51_sanitize = { 52 cfi = true 53 cfi_cross_dso = true 54 boundary_sanitize = true 55 debug = false 56 integer_overflow = true 57 ubsan = true 58} 59 60_public_configs = [ ":scan_service_config" ] 61 62_include_dirs = [ 63 "${print_path}/frameworks/innerkitsimpl/scan_impl/include", 64 "${print_utils_path}/include", 65] 66 67_deps = [ 68 "${print_path}/frameworks/ISaneBackends:sane_backends", 69 "${print_path}/frameworks/models/scan_models:scan_models", 70 "${print_path}/frameworks/innerkitsimpl/scan_impl:scan_client", 71] 72 73_external_deps = [ 74 "ability_base:base", 75 "ability_base:want", 76 "ability_base:zuri", 77 "ability_runtime:ability_manager", 78 "ability_runtime:abilitykit_native", 79 "access_token:libaccesstoken_sdk", 80 "backends:sane", 81 "bundle_framework:appexecfwk_base", 82 "bundle_framework:appexecfwk_core", 83 "cJSON:cjson", 84 "c_utils:utils", 85 "common_event_service:cesfwk_innerkits", 86 "drivers_interface_usb:libusb_proxy_1.0", 87 "eventhandler:libeventhandler", 88 "hilog:libhilog", 89 "hisysevent:libhisysevent", 90 "init:libbegetutil", 91 "ipc:ipc_core", 92 "jsoncpp:jsoncpp", 93 "libjpeg-turbo:turbojpeg", 94 "napi:ace_napi", 95 "netmanager_ext:mdns_manager_if", 96 "netmanager_ext:mdns_manager_if", 97 "os_account:os_account_innerkits", 98 "safwk:system_ability_fwk", 99 "samgr:samgr_proxy", 100 "usb_manager:usbsrv_client", 101] 102 103ohos_shared_library("scan_service") { 104 sources = _sources 105 branch_protector_ret = _branch_protector_ret 106 sanitize = _sanitize 107 public_configs = _public_configs 108 include_dirs = _include_dirs 109 deps = _deps 110 external_deps = _external_deps 111 112 if (debug_enable) { 113 cflags_cc += [ "-DDEBUG_ENABLE" ] 114 } 115 if (build_variant == "user") { 116 cflags_cc += [ "-DIS_RELEASE_VERSION" ] 117 } 118 119 subsystem_name = "print" 120 part_name = "print_fwk" 121} 122 123ohos_static_library("scan_service_test") { 124 sources = _sources 125 branch_protector_ret = _branch_protector_ret 126 sanitize = _sanitize 127 public_configs = _public_configs 128 include_dirs = _include_dirs 129 deps = _deps 130 external_deps = _external_deps 131 132 if (debug_enable) { 133 cflags_cc += [ "-DDEBUG_ENABLE" ] 134 } 135 if (build_variant == "user") { 136 cflags_cc += [ "-DIS_RELEASE_VERSION" ] 137 } 138 139 subsystem_name = "print" 140 part_name = "print_fwk" 141} 142