1# Copyright (c) 2025 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/config/components/idl_tool/idl.gni") 15import("//build/ohos.gni") 16 17cflags_cc = [] 18 19idl_interface_sources = [ 20 "${target_gen_dir}/sane_backends_proxy.cpp", 21 "${target_gen_dir}/sane_backends_stub.cpp", 22] 23 24idl_gen_interface("sane_backends_interface") { 25 src_idl = rebase_path("ISaneBackends.idl") 26 dst_file = string_join(",", idl_interface_sources) 27 log_domainid = "0xD001C00" 28 log_tag = "scankit" 29} 30 31config("sane_config") { 32 include_dirs = [ 33 "include", 34 "${target_gen_dir}", 35 "${print_utils_path}/include", 36 ] 37 cflags_cc += [ 38 "-fno-exceptions", 39 "-fdata-sections", 40 "-ffunction-sections", 41 "-fno-asynchronous-unwind-tables", 42 "-fno-unwind-tables", 43 "-flto", 44 "-Os", 45 ] 46 if (target_cpu == "arm") { 47 cflags = [ "-DBINDER_IPC_32BIT" ] 48 } 49} 50 51ohos_shared_library("sane_backends") { 52 public_configs = [ ":sane_config" ] 53 output_values = get_target_outputs(":sane_backends_interface") 54 sources = [ 55 "src/sane_control_param.cpp", 56 "src/sane_device.cpp", 57 "src/sane_option_descriptor.cpp", 58 "src/sane_out_param.cpp", 59 "src/sane_parameters.cpp", 60 "src/sane_picture_data.cpp", 61 ] 62 sources += filter_include(output_values, [ "*.cpp" ]) 63 defines = [ "AMS_LOG_TAG = \"scankit\"" ] 64 deps = [ ":sane_backends_interface" ] 65 external_deps = [ 66 "ability_base:want", 67 "bundle_framework:appexecfwk_base", 68 "bundle_framework:appexecfwk_core", 69 "c_utils:utils", 70 "hilog:libhilog", 71 "ipc:ipc_single", 72 "jsoncpp:jsoncpp", 73 "safwk:system_ability_fwk", 74 "samgr:samgr_proxy", 75 ] 76 innerapi_tags = [ "platformsdk" ] 77 subsystem_name = "print" 78 part_name = "print_fwk" 79} 80