1# Copyright (c) 2023 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("ability_config") { 20 visibility = [ ":*" ] 21 include_dirs = [ 22 "${print_path}/frameworks/innerkitsimpl/print_impl/include", 23 "${print_path}/frameworks/kits/extension/include", 24 "${print_utils_path}/include", 25 "//third_party/node/src", 26 ] 27 28 cflags = [] 29 if (target_cpu == "arm") { 30 cflags += [ "-DBINDER_IPC_32BIT" ] 31 } 32 defines = [ 33 "APP_LOG_TAG = \"Ability\"", 34 "LOG_DOMAIN = 0xD002200", 35 ] 36} 37 38config("ability_public_config") { 39 visibility = [ ":*" ] 40 include_dirs = [ 41 "${print_path}/frameworks/innerkitsimpl/print_impl/include", 42 "${print_path}/frameworks/kits/extension/include", 43 "//third_party/libuv/include", 44 "//third_party/json/include", 45 ] 46 47 cflags_cc += [ "-fno-exceptions" ] 48} 49 50ohos_shared_library("print_extension_framework") { 51 include_dirs = [ 52 "${print_path}/frameworks/helper/print_helper/include", 53 "${print_path}/frameworks/models/print_models/include", 54 "${print_path}/frameworks/innerkitsimpl/print_impl/include", 55 "${print_path}/frameworks/kits/extension/include", 56 ] 57 58 branch_protector_ret = "pac_ret" 59 sanitize = { 60 cfi = true 61 cfi_cross_dso = true 62 boundary_sanitize = true 63 debug = false 64 integer_overflow = true 65 ubsan = true 66 } 67 68 sources = [ 69 "src/js_print_callback.cpp", 70 "src/js_print_extension.cpp", 71 "src/js_print_extension_connection.cpp", 72 "src/js_print_extension_context.cpp", 73 "src/print_extension.cpp", 74 "src/print_extension_context.cpp", 75 ] 76 configs = [ ":ability_config" ] 77 public_configs = [ 78 ":ability_public_config", 79 "${ability_runtime_path}/frameworks/native/ability:ability_context_public_config", 80 ] 81 82 deps = [ 83 "${print_path}/frameworks/helper/print_helper:print_helper", 84 "${print_path}/frameworks/innerkitsimpl/print_impl:print_client", 85 "${print_path}/frameworks/models/print_models:print_models", 86 ] 87 88 external_deps = [ 89 "ability_base:want", 90 "ability_runtime:ability_context_native", 91 "ability_runtime:ability_manager", 92 "ability_runtime:ability_start_options", 93 "ability_runtime:abilitykit_native", 94 "ability_runtime:app_context", 95 "ability_runtime:extensionkit_native", 96 "ability_runtime:napi_common", 97 "ability_runtime:runtime", 98 "c_utils:utils", 99 "common_event_service:cesfwk_innerkits", 100 "eventhandler:libeventhandler", 101 "hilog:libhilog", 102 "ipc:ipc_napi", 103 "ipc:ipc_single", 104 "ipc:rpc", 105 "napi:ace_napi", 106 ] 107 108 if (build_variant == "user") { 109 cflags_cc += [ "-DIS_RELEASE_VERSION" ] 110 } 111 112 subsystem_name = "print" 113 part_name = "print_fwk" 114} 115 116ohos_shared_library("print_extension_module") { 117 sources = [ "${print_path}/frameworks/kits/extension/src/print_extension_module_loader.cpp" ] 118 119 configs = [ ":ability_config" ] 120 public_configs = [ ":ability_public_config" ] 121 122 branch_protector_ret = "pac_ret" 123 sanitize = { 124 cfi = true 125 cfi_cross_dso = true 126 boundary_sanitize = true 127 debug = false 128 integer_overflow = true 129 ubsan = true 130 } 131 132 deps = [ ":print_extension_framework" ] 133 134 external_deps = [ 135 "ability_base:base", 136 "ability_base:want", 137 "ability_base:zuri", 138 "ability_runtime:abilitykit_native", 139 "ability_runtime:runtime", 140 "c_utils:utils", 141 "common_event_service:cesfwk_innerkits", 142 "hilog:libhilog", 143 "hisysevent:libhisysevent", 144 "ipc:ipc_napi", 145 "ipc:ipc_single", 146 "napi:ace_napi", 147 ] 148 149 if (build_variant == "user") { 150 cflags_cc += [ "-DIS_RELEASE_VERSION" ] 151 } 152 153 relative_install_dir = "extensionability" 154 subsystem_name = "print" 155 part_name = "print_fwk" 156} 157