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