1# Copyright (c) 2024 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_ndk_config") { 19 visibility = [ ":*" ] 20 include_dirs = [] 21 22 cflags_cc += [ 23 "-fno-exceptions", 24 "-fdata-sections", 25 "-ffunction-sections", 26 "-fno-asynchronous-unwind-tables", 27 "-fno-unwind-tables", 28 "-flto", 29 "-Os", 30 ] 31} 32 33ohos_shared_library("ohscan") { 34 include_dirs = [ 35 "include", 36 "${print_path}/frameworks/innerkitsimpl/scan_impl/include", 37 "${print_path}/frameworks/helper/scan_helper/include", 38 "${print_utils_path}/include", 39 ] 40 public_configs = [ ":scan_ndk_config" ] 41 42 branch_protector_ret = "pac_ret" 43 sanitize = { 44 cfi = true 45 cfi_cross_dso = true 46 boundary_sanitize = true 47 debug = false 48 integer_overflow = true 49 ubsan = true 50 } 51 52 sources = [ 53 "src/ohscan.cpp", 54 "src/scan_context.cpp", 55 ] 56 57 deps = [ 58 "${print_path}/frameworks/models/scan_models:scan_models", 59 "${print_path}/frameworks/innerkitsimpl/scan_impl:scan_client", 60 ] 61 62 external_deps = [ 63 "ability_base:base", 64 "ability_base:want", 65 "ability_base:zuri", 66 "ability_runtime:ability_manager", 67 "ability_runtime:abilitykit_native", 68 "access_token:libaccesstoken_sdk", 69 "bundle_framework:appexecfwk_base", 70 "bundle_framework:appexecfwk_core", 71 "c_utils:utils", 72 "common_event_service:cesfwk_innerkits", 73 "eventhandler:libeventhandler", 74 "hilog:libhilog", 75 "hisysevent:libhisysevent", 76 "init:libbegetutil", 77 "ipc:ipc_core", 78 "napi:ace_napi", 79 "os_account:os_account_innerkits", 80 "safwk:system_ability_fwk", 81 "samgr:samgr_proxy", 82 ] 83 84 if (build_variant == "user") { 85 cflags_cc += [ "-DIS_RELEASE_VERSION" ] 86 } 87 88 relative_install_dir = "ndk" 89 output_name = "ohscan" 90 output_extension = "so" 91 92 install_enable = true 93 subsystem_name = "print" 94 part_name = "print_fwk" 95} 96