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 19_sources = [ 20 "src/hisys_event_util.cpp", 21 "src/operation_queue.cpp", 22 "src/print_bms_death_recipient.cpp", 23 "src/print_bms_helper.cpp", 24 "src/print_callback_proxy.cpp", 25 "src/print_event_subscriber.cpp", 26 "src/print_extension_callback_proxy.cpp", 27 "src/print_security_guard_info.cpp", 28 "src/print_security_guard_manager.cpp", 29 "src/print_service_ability.cpp", 30 "src/print_service_converter.cpp", 31 "src/print_service_helper.cpp", 32 "src/print_service_stub.cpp", 33 "src/print_system_data.cpp", 34 "src/print_user_data.cpp", 35 "src/thread_sync_wait.cpp", 36 "src/vendor_bsuni_driver.cpp", 37 "src/vendor_driver_base.cpp", 38 "src/vendor_driver_group.cpp", 39 "src/vendor_helper.cpp", 40 "src/vendor_ipp_everywhere.cpp", 41 "src/vendor_manager.cpp", 42 "src/vendor_ppd_driver.cpp", 43 "src/vendor_wlan_group.cpp", 44] 45 46_deps = [ "${print_path}/frameworks/models/print_models:print_models" ] 47 48_external_deps = [ 49 "ability_base:base", 50 "ability_base:want", 51 "ability_base:zuri", 52 "ability_runtime:ability_manager", 53 "ability_runtime:abilitykit_native", 54 "access_token:libaccesstoken_sdk", 55 "bundle_framework:appexecfwk_base", 56 "bundle_framework:appexecfwk_core", 57 "c_utils:utils", 58 "common_event_service:cesfwk_innerkits", 59 "drivers_interface_usb:libusb_proxy_1.0", 60 "eventhandler:libeventhandler", 61 "hilog:libhilog", 62 "hisysevent:libhisysevent", 63 "init:libbegetutil", 64 "ipc:ipc_core", 65 "jsoncpp:jsoncpp", 66 "napi:ace_napi", 67 "os_account:os_account_innerkits", 68 "safwk:system_ability_fwk", 69 "samgr:samgr_proxy", 70 "usb_manager:usbsrv_client", 71 "wifi:wifi_sdk", 72] 73 74_public_configs = [ ":print_service_config" ] 75 76_include_dirs = [ 77 "${print_path}/frameworks/innerkitsimpl/print_impl/include", 78 "${print_path}/frameworks/ohprint/include", 79 "${print_utils_path}/include", 80] 81 82_branch_protector_ret = "pac_ret" 83_sanitize = { 84 cfi = true 85 cfi_cross_dso = true 86 boundary_sanitize = true 87 debug = false 88 integer_overflow = true 89 ubsan = true 90} 91 92config("print_service_config") { 93 visibility = [ ":*" ] 94 include_dirs = [ 95 "include", 96 "${print_path}/frameworks/models/print_models/include", 97 ] 98 cflags_cc += [ 99 "-fno-exceptions", 100 "-fdata-sections", 101 "-ffunction-sections", 102 "-fno-asynchronous-unwind-tables", 103 "-fno-unwind-tables", 104 "-flto", 105 "-Os", 106 ] 107} 108 109ohos_shared_library("print_service") { 110 sources = _sources 111 branch_protector_ret = _branch_protector_ret 112 sanitize = _sanitize 113 public_configs = _public_configs 114 include_dirs = _include_dirs 115 deps = _deps 116 external_deps = _external_deps 117 118 cflags_cc += [ "-fvisibility=hidden" ] 119 if (cups_enable) { 120 sources += [ 121 "src/print_cups_attribute.cpp", 122 "src/print_cups_client.cpp", 123 "src/print_cups_wrapper.cpp", 124 ] 125 cflags_cc += [ "-DCUPS_ENABLE" ] 126 external_deps += [ 127 "cJSON:cjson", 128 "cups:cups", 129 "cups-filters:cupsfilters", 130 ] 131 } 132 133 if (security_guard_enabled) { 134 external_deps += [ 135 "security_guard:libsg_collect_sdk", 136 "time_service:time_client", 137 ] 138 cflags_cc += [ "-DSECURITY_GUARDE_ENABLE" ] 139 } 140 141 if (build_variant == "user") { 142 cflags_cc += [ "-DIS_RELEASE_VERSION" ] 143 } 144 145 subsystem_name = "print" 146 part_name = "print_fwk" 147} 148 149ohos_static_library("print_service_test") { 150 sources = _sources 151 branch_protector_ret = _branch_protector_ret 152 sanitize = _sanitize 153 public_configs = _public_configs 154 include_dirs = _include_dirs 155 deps = _deps 156 external_deps = _external_deps 157 158 if (cups_enable) { 159 sources += [ 160 "src/print_cups_attribute.cpp", 161 "src/print_cups_client.cpp", 162 "src/print_cups_wrapper.cpp", 163 ] 164 cflags_cc += [ "-DCUPS_ENABLE" ] 165 external_deps += [ 166 "cJSON:cjson", 167 "cups:cups", 168 "cups-filters:cupsfilters", 169 ] 170 } 171 172 if (security_guard_enabled) { 173 external_deps += [ 174 "security_guard:libsg_collect_sdk", 175 "time_service:time_client", 176 ] 177 cflags_cc += [ "-DSECURITY_GUARDE_ENABLE" ] 178 } 179 180 if (build_variant == "user") { 181 cflags_cc += [ "-DIS_RELEASE_VERSION" ] 182 } 183 184 subsystem_name = "print" 185 part_name = "print_fwk" 186} 187