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:rpc",
104    "napi:ace_napi",
105  ]
106
107  if (build_variant == "user") {
108    cflags_cc += [ "-DIS_RELEASE_VERSION" ]
109  }
110
111  subsystem_name = "print"
112  part_name = "print_fwk"
113}
114
115ohos_shared_library("print_extension_module") {
116  sources = [ "${print_path}/frameworks/kits/extension/src/print_extension_module_loader.cpp" ]
117
118  configs = [ ":ability_config" ]
119  public_configs = [ ":ability_public_config" ]
120
121  branch_protector_ret = "pac_ret"
122  sanitize = {
123    cfi = true
124    cfi_cross_dso = true
125    boundary_sanitize = true
126    debug = false
127    integer_overflow = true
128    ubsan = true
129  }
130
131  deps = [ ":print_extension_framework" ]
132
133  external_deps = [
134    "ability_base:base",
135    "ability_base:want",
136    "ability_base:zuri",
137    "ability_runtime:abilitykit_native",
138    "ability_runtime:runtime",
139    "c_utils:utils",
140    "common_event_service:cesfwk_innerkits",
141    "hilog:libhilog",
142    "hisysevent:libhisysevent",
143    "napi:ace_napi",
144  ]
145
146  if (build_variant == "user") {
147    cflags_cc += [ "-DIS_RELEASE_VERSION" ]
148  }
149
150  relative_install_dir = "extensionability"
151  subsystem_name = "print"
152  part_name = "print_fwk"
153}
154