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] 48 49_branch_protector_ret = "pac_ret" 50_sanitize = { 51 cfi = true 52 cfi_cross_dso = true 53 boundary_sanitize = true 54 debug = false 55 integer_overflow = true 56 ubsan = true 57} 58 59_public_configs = [ ":scan_service_config" ] 60 61_include_dirs = [ 62 "${print_path}/frameworks/innerkitsimpl/scan_impl/include", 63 "${print_utils_path}/include", 64] 65 66_deps = [ 67 "${print_path}/frameworks/ISaneBackends:sane_backends", 68 "${print_path}/frameworks/helper/scan_helper:scan_helper", 69 "${print_path}/frameworks/innerkitsimpl/scan_impl:scan_client", 70] 71 72_external_deps = [ 73 "ability_base:base", 74 "ability_base:want", 75 "ability_base:zuri", 76 "ability_runtime:ability_manager", 77 "ability_runtime:abilitykit_native", 78 "access_token:libaccesstoken_sdk", 79 "backends:sane", 80 "bundle_framework:appexecfwk_base", 81 "bundle_framework:appexecfwk_core", 82 "cJSON:cjson", 83 "c_utils:utils", 84 "common_event_service:cesfwk_innerkits", 85 "drivers_interface_usb:libusb_proxy_1.0", 86 "eventhandler:libeventhandler", 87 "hilog:libhilog", 88 "hisysevent:libhisysevent", 89 "init:libbegetutil", 90 "ipc:ipc_core", 91 "jsoncpp:jsoncpp", 92 "libjpeg-turbo:turbojpeg", 93 "napi:ace_napi", 94 "netmanager_ext:mdns_manager_if", 95 "netmanager_ext:mdns_manager_if", 96 "os_account:os_account_innerkits", 97 "safwk:system_ability_fwk", 98 "samgr:samgr_proxy", 99 "usb_manager:usbsrv_client", 100] 101 102ohos_shared_library("scan_service") { 103 sources = _sources 104 branch_protector_ret = _branch_protector_ret 105 sanitize = _sanitize 106 public_configs = _public_configs 107 include_dirs = _include_dirs 108 deps = _deps 109 external_deps = _external_deps 110 111 if (debug_enable) { 112 cflags_cc += [ "-DDEBUG_ENABLE" ] 113 } 114 if (build_variant == "user") { 115 cflags_cc += [ "-DIS_RELEASE_VERSION" ] 116 } 117 118 subsystem_name = "print" 119 part_name = "print_fwk" 120} 121 122ohos_static_library("scan_service_test") { 123 sources = _sources 124 branch_protector_ret = _branch_protector_ret 125 sanitize = _sanitize 126 public_configs = _public_configs 127 include_dirs = _include_dirs 128 deps = _deps 129 external_deps = _external_deps 130 131 if (debug_enable) { 132 cflags_cc += [ "-DDEBUG_ENABLE" ] 133 } 134 if (build_variant == "user") { 135 cflags_cc += [ "-DIS_RELEASE_VERSION" ] 136 } 137 138 subsystem_name = "print" 139 part_name = "print_fwk" 140} 141